Question:

Changing<!DOCTYPE> affecting my page style

by  |  earlier

0 LIKES UnLike

I have 2 pages (A and B), I have coded them and they were fine. then I have noticed that in page A, the text area resize automatically depending on contents, but in page B ( which has the same EXACT css files and styles) doesn't resize automatically.

After comparison, I noticed that page A has:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

while page B has:

<!DOCTYPE html PUBLIC "-//W3C//DTD//DTD XHTML 1.0 Strict//EN"

"http://www.w3.org/TR/xhtml1/DTD/xhtm...

and when I tried to change that tag in page B to the way it is in page A, I found all the CSS styles are missed!!

I read about <!DOCTYPE in w3.org , but I didn't understand anything!!

What's that? is there a way to solve it without effectin the style?

 Tags:

   Report

1 ANSWERS


  1. XHTML strict doctype means your XHTML document will be validated under strict conditions by the W3C (World Wide Web Consortium)

    HTML Transitional can be validated as either HTML 4.01 Loose or Strict.

    There is a difference between XHTML and HTML, so depending on how you have written your HTML documents, it could be valid with one doctype and invalid with another.

    In addition, different browsers interpret HTML styles and elements differently. So this could also be dependent on which browser you are viewing your pages with...

Question Stats

Latest activity: earlier.
This question has 1 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.
Unanswered Questions