|
center html website using css and div |
|
Many time we need to center the html website. Centering the html website can be done very easily using css.
just put your complete html source code which is inside the body tag in one DIV tag and give id="wrapper".
And but below css code in your css file.
div#wrapper { max-width:1050px; min-width:750px; }
div#wrapper { margin-left:auto; margin-right:auto; } This css code for centering your html website will work in both Internet Explorer and Firefox. |
|
|
Div and CSS based design also knows as tableless design, is a method of web design and development without using HTML tables for page layout. In tableless design CSS (Cascading Style Sheets) and DIV are used to arrange elements and text on a web page. Using tableless design, the layout becomes semantically correct. Actually tables should be used for tabular data, but designers use it for layout of website, which is not the intended use of table. The table tag should only be used to format data into a table to relate columns with rows. |
|
Read more... [why tableless design]
|
|
CSS problem in Firefox or Netscape due to Incorrect MIME type |
|
Many time i have came across a problem, in which the website look excellent in Internet Explorer and all distorted in Firefox. The problem here is Firefox is not able to interpret css file. And therefore the page layout is distorted in Firefox. This is becouse the web server/web host where your site is hosetd is not properly configured. Apache web servers are associating files having a .CSS with an incorrect MIME-type such as "text/plain". In some cases, Netscape 7.x and Mozilla ignore the CSS file because of its wrong MIME type and use a default style sheet that causes the layout to be different from what was intended by the web developer. Solution to CSS problem due to Incorrect MIME type: If you are using Apache, you could change configuration of the .htaccess file in your root directory (The .htaccess file is a read-only configuration file that handles a few things including MIME types.). Add this line to your .htaccess file: AddType text/css .css Using a strict document type definition with Firefox means that the web server that serves your web pages needs to be configured appropriately. There are several different solutions to this problem, but the ultimate is to have the correct MIME type associated with .css files. So request you web host provider to configure the server properly. |
|
|
|
|
|
|