Border of different colors

0

I want my text to be bordered as follows:

Top: black
Side: Gray

Here is an example of how you would like it to be:

FollowthepictureasfarasIcan.HowdoImakethetopborderbecomeblackandincreasethedistancesfromthesidesofthetext?Here'stheHTMLandCSSI'musing.

.explicacao_produto{border:1pxsolid#C0C0C0;margin-left:10px;}<h:panelGrouplayout="block" styleClass="explicacao_produto">
                       <h2>Bermuda Lacoste</h2>
                       <p>texto</p>

                       <h4 class="dimensao">Dimensões</h4>
                       <p>- Altura: 9,5cm</p>
                       <p>- Diâmetro: 8cm</p>
                       <p>- Capacidade: 300ml</p>
                       </h:panelGroup>
    
asked by anonymous 06.07.2017 / 07:21

2 answers

5

Manipulate borders with css:

By adding borders to the elements of your page, you have the option to individually manipulate each segment of that border (top, right, left, bottom)

Manipulating the top and bottom edges:

border-top: 1px solid #000;
border-bottom: 1px solid #000;

Manipulating the side edges:

border-left: 1px solid #CCC;
border-right: 1px solid #CCC;

To increase the internal distance of the element we use padding

padding: 5px;

The padding property can also be manipulated by each segment of the top, right, left, bottom object.

  

I do not know if you already know about it, but the W3 Schools site   provides great help in this type of learning.

Check out this tutorial about borders on the W3 site.

    
06.07.2017 / 15:11
0

Using border-right-color and border-left-color for verticals and border-bottom-color and border-top-color you control the color of each border better. The distance between the text and the border you use padding .

    
06.07.2017 / 10:20