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-answer.php below:

Website Navigation


CSS Properties: How to sets all the border properties in one declaration?

CSS Properties: How to sets all the border properties in one declaration?Last update on February 16 2024 13:18:42 (UTC/GMT +8 hours)

Go to Exercise page

Solution:

HTML Code:

<!DOCTYPE html><!-- Declaration of HTML5 document type -->
<html>
<head>
<title>How to sets all the border properties in one declaration</title><!-- Title of the HTML document -->
<style>/* CSS style start*/
h1.xyz {
border-style: solid; /* Setting border style to solid for elements with class "xyz" */
border-width: 1px; /* Setting border width to 1 pixel for elements with class "xyz" */
}
h1.xyz1 {
border-style: solid; /* Setting border style to solid for elements with class "xyz1" */
border-width: medium; /* Setting border width to medium for elements with class "xyz1" */
}
h1.xyz2 {
border-style: solid; /* Setting border style to solid for elements with class "xyz2" */
border-width: 5px; /* Setting border width to 5 pixels for elements with class "xyz2" */
}
</style>
</head>
<body>
<h1 class="xyz">w3resource JavaScript Tutorial.</h1><!-- Heading with class "xyz" -->
<h1 class="xyz1">w3resource Python Tutorial</h1><!-- Heading with class "xyz1" -->
<h1 class="xyz2">w3resource Redis Tutorial.</h1><!-- Heading with class "xyz2" -->
<p><b>Note:</b> The default value is medium none color.</p><!-- Note about default border values -->
</body>
</html>

Explanation:

Live Demo:

See the Pen border-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