1
There is another way to format only the right and left borders, and leave top and bottom None ?
border-top: 0px;
border-bottom: 0px;
border-right: 2px solid #444444;
border-left: 2px solid #444444;
1
There is another way to format only the right and left borders, and leave top and bottom None ?
border-top: 0px;
border-bottom: 0px;
border-right: 2px solid #444444;
border-left: 2px solid #444444;
2
You can do as follows, where the property border-width
will set the width of the edges:
button {
border-width: 0 2px 0 2px; /* Ordem: top, right, bottom, left */
border-style: solid;
border-color: #444;
}
<button type="button">Botão</button>
Or you can do:
button {
border: #444 solid;
border-width: 0 2px 0 2px;
}
<button type="button">Botão</button>
And also (Suggestion of @lazyFox):
button {
border: none;
border-left: 2px solid #444;
border-right: 2px solid #444;
}
<button type="button">Botão</button>
1
0
They forgot a variation:
button {
border: 2px #444 solid;
border-bottom: none;
border-top: none;
}
<button type="button">Botão</button>
if two rules have the same force, the one that is declared last is the one that will be valid.
OBS: border: none;
or border: 0;
both are valid, I prefer border: 0
because it’s shorter;
Exactly, nice catch
Browser other questions tagged html5 css3
You are not signed in. Login or sign up in order to post.
I edited your reply @Paulo adding one more example. I was unaware of this use of
border-width: 0 2px 0 2px;
, I don’t usually use but thought I only received a "parameter"– lazyFox
Fine! I’ll just change the value to
2px
which is what he put in the question. Thanks!– user98628
Helped me, thank you lazyFox and @Pauloimon
– Eduardo Sene