Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Classes...?

Status
Not open for further replies.

adamsoderqvist

Programmer
Sep 8, 2001
136
SE
Hi I'm new with CSS!

I want to be able to alter the layout in a large amount of ASP files using SS and implement it with classes.

what would the <style>.MyClass (code) </style> SS-code be if I want:

Font to be: arial, tahoma
Font size: -2
 
.myClass
{
font-family: /* my fonts here seperated by comas in order of importance */ ;
font-size : 12px ; /* we don't use a size as in old HTML anymore you can try px em and a few others */
} Gary Haran
 
ok, this is what I have:

<style>
.BodyBG {background:white url(Pics/Backpic.jpg) no-repeat center}
.BasicTextBox {&quot;background-color: #ffffff; border: solid 1px #808080; color: #808080; font-size: 8pt; font-family: arial&quot;
.BasicButton {&quot;background-color: #ffffff; border: solid 1px #808080; font-size: 7pt;&quot;
</style>

The only problem is that the background picture (.BodyBG) doesn't show anymore! It did before, but now it wont. In my document I have this code:

<html>

<body ... class=BodyBG>

<input type=text class=BasicTextBox>

</html>

...and all of a sudden the background isn't there... what to do?



 
try changing to this :

<style>
.BodyBG
{
background: white url(&quot;Pics/Backpic.jpg&quot;) no-repeat center
}
.BasicTextBox
{
background-color: #ffffff;
border: 1px solid #808080;
color: #808080;
font-size: 8pt;
font-family: arial;
}
.BasicButton
{
background-color: #ffffff;
border: 1px solid #808080;
font-size: 7pt;
}
</style>

Don't use double quotes for the entirity of your definition like :

.BasicButton {&quot;background-color: #ffffff; border: solid 1px #808080; font-size: 7pt;&quot;

for your background not showing you should use only lowercase names for your images. always. save them as lowercase and link to them as lowercase. Gary Haran
 
change this:

.BodyBG {background:white url(Pics/Backpic.jpg) no-repeat center}

to this:

.BodyBG {background-color:white; background-image: url(&quot;Pics/Backpic.jpg&quot;); background-repeat: no-repeat;}

Tony
reddot.gif WIDTH=300 HEIGHT=2 VSPACE=3

 
Would it not be better as simply

<body>

and in you stylesheet as

body {background: url(&quot;Pics/Backpic.jpg&quot;) #ffffff no-repeat center}


Not saying it cant be done just that I have never seen <body class=&quot;&quot;> before



É

endamcg-logo1b.gif

 
Thanx everyone, Tony is right!
It's not all pages that should look exactly the same, which is why I need to be able to use a class to &quot;trigger&quot; whenever the background should be the specific image...!

Anyway, now it works!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top