homepage Welcome to WebmasterWorld Guest from 54.226.43.155
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / CSS
Forum Library, Charter, Moderator: open

CSS Forum

    
renaming css
doob




msg:4053436
 10:34 pm on Jan 3, 2010 (gmt 0)

How should I be handling depricated css names?

Is there someway to put something like .copyBold = .copy .bold?

I want to rename and cleanup some redunant names but am worried that I just wont be able to do a find and replace in php or htm code on every page

Is there someway in the .css document to tell a class to use a different class?

 

limbo




msg:4053678
 12:00 pm on Jan 4, 2010 (gmt 0)

Hi Doob

Could you post up a little example of how a couple of lines of HTML and CSS look?

You can declare the same properties for classes like this:

.copy, .bold {font-weight:bold;}

...but without seeing the CSS it's hard to say if this is what you are looking for

doob




msg:4057205
 7:04 am on Jan 9, 2010 (gmt 0)

I did a bunch of cleanup to my css but am still relying on .copyBold and .copyBoldWhite

This works
<span class="copy bold">this makes it bold</span>

This works
<span class="copy white">this makes it white, but not bold</span>

This doesn't work
<span class="copy bold white">this makes it white, but not bold but I think it should make it copy, bold and white! #*$!</span>

.white {color:#ffffff;}
.bold {font-weight: 800;}
.copy
{
font-family: arial, helvetica, san-serif;
line-height: 130%;
font-size:12px;
font-weight: 400;
color: #000000;
}
.copyBold
{
font-family: arial, helvetica, san-serif;
line-height: 130%;
font-size:12px;
font-weight: 800;
color: #000000;
}
.copyBold
{
font-family: arial, helvetica, san-serif;
line-height: 130%;
font-size:12px;
font-weight: 800;
color:#ffffff;
}

Drag_Racer




msg:4058358
 3:55 pm on Jan 11, 2010 (gmt 0)

.bold is declared before .copy in your css file so .copy is overwriting your previous font-weight declaration

place .bold after .copy in the css file

Fotiman




msg:4058424
 5:41 pm on Jan 11, 2010 (gmt 0)

doob, I would suggest you read this thread:
[webmasterworld.com...]
Which explains why using class names like "bold" and "white" are bad.

doob




msg:4058776
 2:04 am on Jan 12, 2010 (gmt 0)

Thanks Drag Racer for that tip!

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / CSS
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved