A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.w3resource.com/html-css-exercise/css-properties/border-top-style-answer.php below:

Website Navigation


CSS Properties: How to set the style of the top border?

CSS Properties: How to set the style of the top border?Last update on February 20 2024 12:26:17 (UTC/GMT +8 hours)

Go to Exercise page

Solution:

HTML Code:

<!DOCTYPE html><!-- Declares the document type as HTML -->
<html><!-- Root element of the HTML document -->
<head><!-- Contains metadata about the HTML document -->
<title>How to set the style of the top border</title><!-- Sets the title of the HTML document -->
<style type="text/css"> /* Begins a CSS style block */
h1 {border-style: solid;} /* Defines a default CSS rule for h1 elements to have a solid border style */
h1.abc {border-top-style: none;} /* Sets the top border style of h1 elements with class "abc" to none */
h1.dotted {border-top-style: dotted;} /* Sets the top border style of h1 elements with class "dotted" to dotted */
h1.dashed {border-top-style: dashed;} /* Sets the top border style of h1 elements with class "dashed" to dashed */
h1.solid {border-top-style: solid;} /* Sets the top border style of h1 elements with class "solid" to solid */
h1.double {border-top-style: double;} /* Sets the top border style of h1 elements with class "double" to double */
h1.groove {border-top-style: groove;} /* Sets the top border style of h1 elements with class "groove" to groove */
h1.ridge {border-top-style: ridge;} /* Sets the top border style of h1 elements with class "ridge" to ridge */
h1.inset {border-top-style: inset;} /* Sets the top border style of h1 elements with class "inset" to inset */
h1.outset {border-top-style: outset;} /* Sets the top border style of h1 elements with class "outset" to outset */
h1.hidden {border-top-style: hidden;} /* Sets the top border style of h1 elements with class "hidden" to hidden */
h1.initial {border-top-style: initial;} /* Sets the top border style of h1 elements with class "initial" to initial */
</style><!-- Ends the CSS style block -->
</head><!-- Ends the head section of the HTML document -->
<body><!-- Contains the content of the HTML document -->
<h1 class="none">No border style</h1><!-- Displays an h1 element with no border style -->
<h1 class="dotted">A dotted border style</h1><!-- Displays an h1 element with a dotted border style -->
<h1 class="dashed">A dashed border style</h1><!-- Displays an h1 element with a dashed border style -->
<h1 class="solid">A solid border style</h1><!-- Displays an h1 element with a solid border style -->
<h1 class="double">A double border style</h1><!-- Displays an h1 element with a double border style -->
<h1 class="groove">A groove border style</h1><!-- Displays an h1 element with a groove border style -->
<h1 class="ridge">A ridge border style</h1><!-- Displays an h1 element with a ridge border style -->
<h1 class="inset">An inset border style</h1><!-- Displays an h1 element with an inset border style -->
<h1 class="outset">An outset border style</h1><!-- Displays an h1 element with an outset border style -->
<h1 class="hidden">A hidden border style</h1><!-- Displays an h1 element with a hidden border style -->
<h1 class="initial">A initial border style, like as no border</h1><!-- Displays an h1 element with an initial border style, like no border -->
</body><!-- Ends the body section of the HTML document -->
</html><!-- Ends the HTML document -->

Explanation:

Live Demo:

See the Pen border-top-style-answer by w3resource (@w3resource) on CodePen.

See the solution in the browser

Supported browser

Go to Exercise page

What is the difficulty level of this exercise?

Test your Programming skills with w3resource's quiz.




RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4