Skip to content
Related Articles
Get the best out of our app
GeeksforGeeks App
Open App
geeksforgeeks
Browser
Continue

Related Articles

How to specify no border in CSS ?

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

In this article, we see how to specify no border in CSS, we have three common methods,

Approach 1:

Example: In this example, we are using the above-explained approach.

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: In this example, we are using the above approach.

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: In this example, we are using the above-explained approach.

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
Last Updated : 04 May, 2023
Like Article
Save Article
Similar Reads
Related Tutorials