Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS - Add border to all divs

Tags:

html

css

I was wondering if there was any "easy" way to add through css lets say:

border: 1px solid red;

to all divs no matter what their id´s are.

I realize this might be a very very basic question (or no possible at all) and I hope it is clear enough.

Just to clarify, lets say I´ve got:

HTML

<div id="one">

</div>

<div id="two">

</div>

and CSS

#one{
height: 10px;
width: 10px;
}

#two{
height: 10px;
width: 10px;
}

The result I actually want is:

#one{

height: 10px;
width: 10px;
border: 1px solid red;
}

#two{
height: 10px;
width: 10px;
border: 1px solid red;
}

I want to achieve this without having to go one by one.

Thanks in advance!!

Please ask for any clarification needed!

like image 990
Trufa Avatar asked Oct 26 '10 21:10

Trufa


People also ask

Can you add borders in CSS?

The CSS border properties allow you to specify the style, width, and color of an element's border.


1 Answers

div {
    border: 1px solid #000000;
}
like image 104
McAden Avatar answered Oct 03 '22 11:10

McAden