Fastest code for changing fonts and colors?

Discussion in 'HTML & Website Design' started by chuckypita, Aug 21, 2008.

  1. #1
    OMG - everytime I change the fonts and colors in my posts it takes me FOREVER.

    Does anyone have any quick and easy shortcuts for this?
     
    chuckypita, Aug 21, 2008 IP
  2. bavington

    bavington Peon

    Messages:
    74
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Sounds like you are using <font> Tags?

    You should take some research on CSS, as you can update your entire web-site from one simple file.

    Post a link so that we can see what and how you've done your styles.
     
    bavington, Aug 21, 2008 IP
  3. chuckypita

    chuckypita Peon

    Messages:
    88
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    chuckypita, Aug 21, 2008 IP
  4. mob4u1

    mob4u1 Guest

    Best Answers:
    0
    #4
    eg: change:

    <font color="#FF0000" face="arial">TEXT HERE</font>

    to:

    <span class="red">TEXT HERE</span>

    and have this in a css file:

    .red {color: #FF0000; font: arial; }
     
    mob4u1, Aug 21, 2008 IP
  5. The_Studio

    The_Studio Peon

    Messages:
    97
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    as said a bove get some css in your website
    google w3schools and learn the css stuff they have
     
    The_Studio, Aug 21, 2008 IP
  6. chuckypita

    chuckypita Peon

    Messages:
    88
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Thanks Mob! That's great information
     
    chuckypita, Aug 23, 2008 IP
  7. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #7
    NOT that a class should ever say how it appears. If you move to CSS your classes and ID's should say what things are, NOT how it appears. In fact anything that says how it appears does not belong in the HTML once you start using CSS.

    Take your average news page, it's a block of linked elements, so you'd wrap that in a DIV with a class.

    <div class="newsItem">

    It has a title, title is a heading, so use a heading tag. Usually there's a date - I like to put the date in the heading. If we use a span we can avoid wasting a class.

    <h2><span>Today 23 August 2008</span> Nothing happened</h2>

    Then you have the content

    <p>
    Nothing much really, got up at 2PM, rode to shaws to buy hot dog rolls, killed some hackers by banning them with IPTables, etc
    </p>

    and of course a section with information like comments.

    <div class="comments">
    <a href="comments.php?article=1">Comments (20)</a>
    </div>

    and you close the div - making the HTML for the whole sectuon thus:

    
    <div class="newsItem">
    	<h2><span>Today 23 August 2008</span> Nothing happened</h2>
    	<p>
    		Nothing much really, got up at 2PM, rode to shaws to buy hot dog rolls, killed some hackers by banning them with IPTables, etc.
    	</p>
    	<div class="comments">
    		<a href="comments.php?article=1">Comments (20)</a>
    	</div>
    <!-- .newsItem --></div>
    
    Code (markup):
    Everything else should be applied via your CSS.
    
    .newsItem {
    	padding:4px;
    	color:#000;
    	background:#EEE;
    	border:1px solid #248;
    }
    
    .newsItem h2 {
    	padding:0 12px;
    	font:bold 16px/20px sans-serif;
    	color:#248;
    	background:#DEF;
    	border-bottom:1px solid #248;
    }
    	
    .newsItem h2 span {
    	float:right;
    	font:normal 14px/20px sans-serif;
    }	
    
    .newsItem p {
    	margin:1em 12px;
    }
    
    .newsItem .comments {
    	text-align:right;
    	padding:0 12px;
    	color:#248;
    	background:#DEF;
    	border-top:1px solid #248;
    }
    
    Code (markup):
    GREATLY simplifies matters if you have say... twenty of those on a page.

    Presentational tags like FONT and CENTER, as well as presentational elements like ALIGN, VALIGN, etc, were deprecated in strict doctypes for a reason. If we're getting rid of presentational tags, using presentational classes and ID's (red, center, clearfix) doesn't make a whole lot of sense EITHER.
     
    deathshadow, Aug 23, 2008 IP