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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Substitute HTML for CSS

Status
Not open for further replies.

SteveHigh

Technical User
Jan 17, 2007
158
GB
Hello

I have used as much CSS as I know how to in the code below, but there still seems to be quite a lot of HTML for the browser to 'read'.

Would anyone know how I may substitute the remaining HTML below, please?


body { font-family: verdana;
font-weight: normal;
color: #FFFFFF;
font-size: 11px
}

tr, td {
font-family: "Courier New";
color: #87CEFA;
font-size: 16px

</HEAD>

<BODY BGCOLOR="black" LEFTMARGIN="0" TOPMARGIN="0" MARGINWIDTH="0" MARGINHEIGHT="0"
ALINK="#87CEFA" LINK="#87CEFA" VLINK="#87CEFA" TEXT="#FFFFFF">

<CENTER><TABLE WIDTH="100%" CELLSPACING="0" CELLPADDING="0" BORDER="0">
<TR><TD WIDTH="60%" HEIGHT="200"><p><b>
<tt>somewords here</tt></b></p>


<font color="E0FFFF" size="16"><center><b><tt>Name</tt></b></center></font>
</TD></TR>

<TR><TD WIDTH="85%">
<TR><TD BGCOLOR="#000000"><FONT FACE="verdana, sans serif" SIZE="1" COLOR="#40D6F6">

<CENTER>| <A HREF="about.html" target="FRAME1"><b>about us</b></A> | <A HREF="contact.html" TARGET="FRAME1"><b>contact</b></A> | <A HREF="portfolio.html" TARGET="FRAME1"><b>portfolio</b></A> | <A HREF="guestbook.html" TARGET="FRAME1"><b>guestbook</b></A> | </CENTER>
</FONT></TD></TR>

<p><TR><TD VALIGN="CENTER" ALIGN="MIDDLE">
<IFRAME NAME="FRAME1" SRC="about.html" TARGET="FRAME1" SCROLLING="AUTO" WIDTH="75%" HEIGHT="300"
ALLOWTRANSPARENCY="TRUE" FRAMEBORDER="NO"></IFRAME></TD></TR></TABLE></CENTER>


<p><center>Created and developed in <FONT COLOR="#00FF33">Name</FONT>
by <FONT COLOR="#87CEFA">Name</FONT>
<br>for Name (registered) © Name</font></center></p>

</BODY>
 
1) Remove all of the attributes of every element from your example
2) Remove the font, b, br and center tags

Then, have a look at as you haven't grasped how CSS is implemented.



____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.
 
Another area of the w3schools site that can help you is the XHTML section. Look there to learn which of the tags you're using should be expressed as CSS and which are still supported in HTML. For example, all your COLOR and FONT attributes definitely need to go into the CSS, using class selectors to tie them to the HTML elements to which they are applied. But some of your tags ( <TD> for example ) support the WIDTH attribute in the HTML.

Also, look for tags that are deprecated, like <CENTER> for example.

Just a small example of what to do: Change
Code:
<p><center>Created and developed in <FONT COLOR="#00FF33">Name</FONT>
by <FONT COLOR="#87CEFA">Name</FONT>
<br>for Name (registered) © Name</font></center></p>

to

Code:
<style type="text/css">
.copyright {
  text-align:center
}
.copyrightin {
  color: #00FF33;
}
.copyrightfor {
  color:  #87CEFA
}
</style>
</head>
<body>
.
.
.
<div class="copyright">
Created and developed in <span class="copyrightin">Name</span>
by <span class="copyrightfor">Name</span>
<br>for Name (registered) © Name
</div>

There might be some typos in there but you get the idea. Also, note that ALL tags should be lower case. In XHTML, tags are case-sensitive. Since you're converting to CSS, you might as well convert to XHTML also.



Mike Krausnick
Dublin, California
 
That's great - very manys thanks for your help.

I'll get to work on your suggestions, and let you know.

Thanks again.

Steve
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top