While using this site, you agree to have read and accepted our

To have only the bottom border, set the border-bottom-style to "groove" and then, add a background-color. The border-bottom-style property in CSS is used to set the style of the bottom border of an element.. Syntax: border-bottom-style:none|hidden|dotted|dashed|solid|double|groove| ridge|inset|outset|initial|inherit; Property Values: none: It is the default value and it makes the width of bottom border to zero. W3Schools is optimized for learning, testing, and training. W3Schools is optimized for learning, testing, and training. Examples might be simplified to improve reading and basic understanding. Property Values

border-bottom: 5px solid red;} h2 { border-bottom: 4px dotted blue;} div { border-bottom: double;} service {display: inline-block; width: 80 %; margin: 0 10 % 0 10 %; /* border-bottom: 2px solid darkgrey;*/}. By changing the thickness of the border, the starting size and the scale factor, you can get to just about thickness-length ratio you want. CSS - Borders. Advertisements. The first border declaration will be the equivalent color to a 50% opaque red border over a white background (although any graphics under the border will not bleed through). text. Hence, it … With CSS (Linear Gradient): We can use linear-gradient() to create a background image(s) and control its size and position with CSS so that it looks like a border.

Set the border-top-style, border-right-style, border-left-style properties of the element to "hidden". service ul {padding: 0; list-style-type: square;}. Previous Page. And here is my CSS:. If the second value is omitted, it is copied from the first. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. W3Schools is optimized for learning, testing, and training. While using this site, you agree to have read and accepted our Hence, it is not visible. Examples: border-width: thin medium thick 10px; top border is thin; right border is medium; bottom border is thick; left border is 10px; border-width: thin medium thick; top border is thin; right and left borders are medium

However we can mimic border effect and control its width and height as we want with some other ways.

Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. You can individually change the color of the bottom, left, top and right sides of an element's border using the properties −The following example shows the effect of all these properties −The border-style property allows you to select one of the following styles of border −You can individually change the style of the bottom, left, top, and right borders of an element using the following properties −The following example shows all these border styles −The border-width property allows you to set the width of an element borders. The border-style specifies whether a border should be solid, dashed line, double line, or one of the other … border-bottom: 1px; border-bottom: 2px dotted; border-bottom: medium dashed green; Les trois valeurs de la propriété raccourcie peuvent être définies dans n'importe quel ordre et une ou deux d'entre elles peuvent être absentes. CSS p { font-size:30px; line-height:3em; } div.pos { width:49%; text-align:center; border:2px solid #00f; } div#abs { position:absolute; bottom:0; left:0; } div#fix { position:fixed; bottom:0; right:0; } HTML ; Use the :focus pseudo-class with the "no-outline" class to style the form fields that are focused by the user. If either length is zero, the corner is square, not rounded. li:hover > a span { border-bottom: 2px solid green; } … The value of this property could be either a length in px, pt or cm or it should be set to You can individually change the width of the bottom, top, left, and right borders of an element using the following properties −The following example shows all these border width −The border property allows you to specify color, style, and width of lines in one property −The following example shows how to use all the three properties into a single property. Next, let's try using one of the width keywords (thin, medium, thick) to set our bottom border width. This property can have from one to four values. Set the style of the bottom border for different elements:If border-bottom-color is omitted, the color applied will be the color of the

With CSS properties, we can only control the thickness of border; not length. I just accomplished the opposite of this using :after and ::after because I needed to make my bottom border exactly 1.3rem wider:. Examples might be simplified to improve reading and basic understanding. In this CSS border-bottom-style example, we have set the width of the bottom border to 2px. Note: If you set two values, the first one is for the bottom border, and the second one for the right border. This is the most frequently used property to set border around any element. service li {font-size: 13 px; color: grey; margin: 2 % 0 2 % 0 %;}. The border-width property sets the width of an element's four borders. service-1 {border-bottom: 2 px solid orange;} The last line of code i.e. Since you are displaying the bottom border for your .service div, it will always be as wide as the div. Add CSS¶. Well organized and easy to understand Web building tutorials with lots of examples of how to use HTML, CSS, JavaScript, SQL, PHP, Python, Bootstrap, Java and XML.