Skip to content
Related Articles
Open in App
Not now

Related Articles

How to specify no border in CSS ?

Improve Article
Save Article
  • Last Updated : 26 Mar, 2021
Improve Article
Save Article

We can specify the no border property using CSS border: none, border-width : 0, border : 0 properties.

Approach 1:

Example:

HTML




<!DOCTYPE html>
<html>
<head>
   <title>No Border CSS</title>
</head>
<body>
 <h1 style="border-color : red ;
            border-style : solid ;
            border-width : 0">GFG Best For Interview Preparation And Much more</h1>
 <h1 style="border-color : red ;
            border-style : solid ;">GFG Best For Interview Preparation And Much more</h1>
</body>
</html>

Output :

no border 

Approach 2 :

  •  We will give border-color, border-style properties to both headings, for showing text with border and no-border.
  • For no border heading, we will use the border : 0 which will result in no border.

Example:

HTML




<!DOCTYPE html>
<html>
<head>
  <title>No Border CSS</title>
</head>
<body>
 <h1 style="border-color : green ;
            border-style : solid ;
            border : 0">GFG Best For Interview Preparation And Much more</h1>
 <h1 style="border-color : green ;
            border-style : solid ;">GFG Best For Interview Preparation And Much more</h1>
</body>
</html>

Output :

no border 

Approach 3:

  •  We will give border-color, border-style properties to both headings, for showing text with border and no-border.
  • For no border heading, we will use the border: none which will result in no border.

Example:

HTML




<!DOCTYPE html>
<html>
<head>
 <title>No Border CSS</title>
</head>
<body>
 <h1 style="border-color : green ;
            border-style : solid ;
            border : none">GFG Best For Interview Preparation And Much more</h1>
 <h1 style="border-color : green ;
            border-style : solid ;">GFG Best For Interview Preparation And Much more</h1>
</body>
</html>

Output :

no border


My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!