Jump to content

Frames And Other Questions


Darkspire

Recommended Posts

1.I have a page that sets up frames and was wondering what DOCTYPE does it require? A.<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd"> or this one? B.<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 2.Do i use B. for the setup page and A. for the frames or A. for both? 3.Ive been using <p align="justify"> is this correct? i know it works, but im unsure as to whether it is the correct syntax? Its just I thought <td width=""> was incorrect but since found it not to be, having said that looking on W3 I found:

Deprecated. Use styles instead.Specifies the width of a cell
I use a seperate linked CSS page for color, fonts and links, ive read that this is a style sheet(?) how would i use styles? Should this be a part of my CSS page? Sorry for all the questions, i have an old HTML 4 book (with CD examples, bonus!) and Google. Thanks Darkspire
Link to comment
Share on other sites

If you're using a <frameset> and <frame> tags, then you need the Frameset DOCTYPE. The pages within the frames can use any DOCTYPE. <p align="justify"> is not valid in HTML 4.01 or XHTML 1.0 Strict. You should use CSS for everything involving presentation. I'm quite sure "justify" is also a proper value for the text-align property. You shouldn't use the width attribute of the <td> element either. You use CSS for fonts and colors, but you also use it to position elements on the page (don't use <table> elements for layout), set dimensions, give backgorund images and colors, and add borders to any element.

Link to comment
Share on other sites

You use CSS for fonts and colors, but you also use it to position elements on the page (don't use <table> elements for layout), set dimensions, give backgorund images and colors, and add borders to any element.
Thanks for the prompt reply, could you point me in the right direction with a link for a good tutorial for how to do this in CSS?Im not the sharpest tool in the box but im not the bluntest either, but all ive managed to pick up so far is color, links and fonts. Thanks Darkspire
Link to comment
Share on other sites

Thanks folks for all the help, ive got the <p> problem sorted out, i made two classes, p.title (no justify) and p.normal (with justify)but cant seem to get table to work.In my frame ive got:

<table  width="100%" align="center" cellspacing="0" cellpadding="0" border="1">

which i tried to replace with an entry in the CSS file:

table  {width:100%; align:center; cellspacing:0; cellpadding:0; border:1;}

Which i am not sure is working as the border doesnt show? Thanks Darkspire

Link to comment
Share on other sites

Only one of those declarations is valid width: 100%, there's not really a valid equivalent css styling for that will work cross browser for cellspacing, so it might be better to use this still within table element, also adding the border to table will result in just the outside of table receiving a border, so you should use

table  {width:100%; text-align:center; border:1px solid #CCCCCC;}table td{border:1px solid #CCCCCC;}

with

<table cellspacing="0" cellpadding="0">  <tr>     <td>abcd efgh ij</td>     <td>abcd efgh ij</td>     <td>abcd efgh ij</td>   </tr></table>

There is a hack you can use that will work, which i have not use recently, that will still work for cellspacing for IE7, but is reported as invalid in css validator

table  {width:100%;text-align:center;border-spacing:0;border-spacing: expression(cellSpacing=0); /* requred for IE7*/border-collapse:collapse;}table td{border:1px solid #CCCCCC;} 

with

<table>  <tr>    <td>abcd efgh ij</td>    <td>abcd efgh ij</td>    <td>abcd efgh ij</td>  </tr></table> 

Link to comment
Share on other sites

Thank you, that works great. Just one question, you have used a text-align in the table define, i thought the align in the <table> in HTML not CSS was to align the table not the text? Thanks Darkspire

Link to comment
Share on other sites

I was not quite sure what you was looking for with align="center" in the table, if a table is a 100% wide, align="center" would be obsolete in centring it. to centre a table with css you would have to use margins, but you would again have to set it any size other than 100% to see the required result.

table  {width:80%;/*text-align:center; */margin: 0 auto;border-spacing:0;border-spacing: expression(cellSpacing=0); /* requred for IE7*/border-collapse:collapse;}table td{border:1px solid #CCCCCC;} 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...