How to center align a web page Level of difficulty:
It is very important to center align the text of a web page. The content should be centered in such a way that it remains in the center only even if the window is maximized or minimized. Center aligning the text not only presents the text very sophisticatedly but also make it clearly visible to the reader. The latest trend in monitors is shape turning more of rectangular than having the old four is to three ratios. The elongated monitors are good for watching movies and playing games but these are not very good for displaying text because it becomes very difficult to read long lines of text that start from one end of the screen to the other. To avoid theses elongated text lines we should center align the text or any other content of the websites. Materials Needed:
- One needs to be an expert programmer. It is very important to have a thorough knowledge of the language you are programming in. if you have not studied the language or have not worked in it you cannot centre a web page by just reading a few guidelines.
The first step is to open your software or the application in which your are creating your website. In this case we are considering the Dreamweaver application. Then after this open either a new file or an already existing file that you would like to modify. Now open the ‘CSS Style’ panel by selecting this option from the window menu.
Now click on the ‘New CSS Rule’ and choose the ‘Tag’ option. By doing this you will be creating a ‘body’ style. Enter the word ‘body’ as it is on the space given against ‘Tag’ and to choose the current document click on the option ‘This Document Only’. The ‘body’ is the most important part as it lets you to fix all the measurements of the page and it also takes care of the over all appearance of the page.
After this a window will appear in which you have to select the ‘Box’ option and set its padding and margins to zero and apply this to all the boxes. After this when you will press ‘OK’ this code will automatically get embedded into the HTML code.
Similarly you can make other changes to the page also like, width, positioning, left, right, bottom and top margins.
Lastly save the file. You can also have a preview of this file by selecting the option from the File menu.