Connecting Tech Pros Worldwide Forums | Help | Site Map

css syntax

sam
Guest
 
Posts: n/a
#1: Feb 10 '06
Hi,

Does anyone know why there is a hash (#) in front of each css style?
please see the following example:

<style type="text/css">
#leftcolumn{
float:left;
width:150px;
height: 400px;
border: 3px solid black;
padding: 5px;
padding-left: 8px;

}

#leftcolumn a{
padding: 3px 1px;
display: block;
width: 100%;
text-decoration: none;
font-weight: bold;
border-bottom: 1px solid gray;
}

#leftcolumn a:hover{
background-color: #FFFF80;
}

#rightcolumn{
float:left;
width:550px;
min-height: 400px;
border: 3px solid black;
margin-left: 10px;
padding: 5px;
padding-bottom: 8px;
}

* html #rightcolumn{ /*IE only style*/
height: 400px;
}
</style>

It should be without hash, I usually use the following css syntax:

body{ background-color: black }
p { color: blue; }
h3{ color: white; }


Thanks
Sam

impaler
Guest
 
Posts: n/a
#2: Feb 10 '06

re: css syntax



sam wrote:[color=blue]
> Hi,
>
> Does anyone know why there is a hash (#) in front of each css style?
> please see the following example:
>
> <style type="text/css">
> #leftcolumn{
> float:left;
> width:150px;
> height: 400px;
> border: 3px solid black;
> padding: 5px;
> padding-left: 8px;
>
> }
>
> #leftcolumn a{
> padding: 3px 1px;
> display: block;
> width: 100%;
> text-decoration: none;
> font-weight: bold;
> border-bottom: 1px solid gray;
> }
>
> #leftcolumn a:hover{
> background-color: #FFFF80;
> }
>
> #rightcolumn{
> float:left;
> width:550px;
> min-height: 400px;
> border: 3px solid black;
> margin-left: 10px;
> padding: 5px;
> padding-bottom: 8px;
> }
>
> * html #rightcolumn{ /*IE only style*/
> height: 400px;
> }
> </style>
>
> It should be without hash, I usually use the following css syntax:
>
> body{ background-color: black }
> p { color: blue; }
> h3{ color: white; }
>
>
> Thanks
> Sam[/color]


it aplies to the element having its id "leftcolumn"

ex:
<td id="leftcolumn"></td>
<td id="rightcolumn"></td>
it will apply the according css

this was an offtopic, it's a javascript group, please don't misspost
anymore

Thomas 'PointedEars' Lahn
Guest
 
Posts: n/a
#3: Feb 10 '06

re: css syntax


sam wrote:
[color=blue]
> Does anyone know why there is a hash (#) in front of each css style?[/color]

Wrong newsgroup.
Dr John Stockton
Guest
 
Posts: n/a
#4: Feb 11 '06

re: css syntax


JRS: In article <2469222.vxSaSxp1AB@PointedEars.de>, dated Fri, 10 Feb
2006 20:10:45 remote, seen in news:comp.lang.javascript, Thomas
'PointedEars' Lahn <PointedEars@web.de> posted :[color=blue]
>sam wrote:
>[color=green]
>> Does anyone know why there is a hash (#) in front of each css style?[/color]
>
>Wrong newsgroup.[/color]

He had already been told that, but in a polite and constructive manner.

Don't post unless you have a useful contribution to make, and see
whether a psychiatrist can do anything about your Himmler complex.

--
© John Stockton, Surrey, UK. ???@merlyn.demon.co.uk Turnpike v4.00 MIME. ©
Web <URL:http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links.
Check boilerplate spelling -- error is a public sign of incompetence.
Never fully trust an article from a poster who gives no full real name.
Thomas 'PointedEars' Lahn
Guest
 
Posts: n/a
#5: Feb 11 '06

re: css syntax


Dr John Stockton wrote:
[color=blue]
> [...] see whether a psychiatrist can do anything about your Himmler
> complex.[/color]

Godwin's Law. You lose.
John Bokma
Guest
 
Posts: n/a
#6: Feb 11 '06

re: css syntax


Thomas 'PointedEars' Lahn <PointedEars@web.de> wrote:
[color=blue]
> Dr John Stockton wrote:
>[color=green]
>> [...] see whether a psychiatrist can do anything about your Himmler
>> complex.[/color]
>
> Godwin's Law. You lose.[/color]

Godwin never said a thing about losing, get it right.

--
John MexIT: http://johnbokma.com/mexit/
personal page: http://johnbokma.com/
Experienced programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html
Closed Thread


Similar JavaScript / Ajax / DHTML bytes