PDA

View Full Version : Multiple css rules possible?



primefalcon
Feb 20th, 2010, 02:55 PM
something along the lines of this I mean?


border-left-style, border-right-style: solid;

I know prob a noob question, but I have just never thought to do this before.

abduraooft
Feb 20th, 2010, 03:40 PM
To get the same borders on all sides, you could use the shortcut property like

border:1px solid red;
To get the border on multiple sides but not on all the four, I'd use something like

border:solid red;
border-width:1px 1px 0 0;

border-left-style, border-right-style: solid;
In such cases, where the styles to be applied on opposite sides, simply use
border:solid red;
border-width:0 1px; /*=> border-width:0 1px 0 1px; */

VIPStephan
Feb 20th, 2010, 03:44 PM
Or if it’s just about the border style:


border-style: none solid;

Top and bottom border style “none” and left and right border style “solid”. It’s just like values for margin or padding. Up to four values are allowed, top, right, bottom, left, and abbreviations of them: three values stand for top, left+right, bottom. Two values for top+bottom, left+right. One value for all four sides.

primefalcon
Feb 20th, 2010, 03:53 PM
That I already knew, bad example I used, I am wanting to know it it possible just to combine different decs like blow


#whatever {
background-color, border-color: #FF0000;
}

I know I could use php in the css file to do this, but I'd prefer not to have to script, since that would defeat the purpose of trying to save on some code

abduraooft
Feb 20th, 2010, 04:02 PM
#whatever {
background-color, border-color: #FF0000;
} No way like this.

primefalcon
Feb 20th, 2010, 04:13 PM
No way like this.
Didn't think so, was hoping I was wrong though, oh well, thanks

Apostropartheid
Feb 20th, 2010, 10:45 PM
You could use PHP to make the color a variable but it's not quite the same.

primefalcon
Feb 20th, 2010, 11:01 PM
yah still would end up adding more code for no real benefit, I use php all the time for conditions of if user is logged in and such and change the color then but....