How to specify no border in CSS ?
We can specify the no border property using CSS border: none, border-width : 0, border : 0 properties.
Approach 1:
- 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-width : 0 which will result in no border.
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
Please Login to comment...