How.com.vn is a “wiki,” similar to Wikipedia, which means that many of our articles are co-written by multiple authors. To create this article, 21 people, some anonymous, worked to edit and improve it over time.
This article has been viewed 227,097 times.
Do you want to center your website content to create equal sized borders to the left and right but want the text to remain left justified? Read on!
Steps
Sample CSS Code
Centering Web Page Content
- Open Notepad or a comparable text editing application.
- Create the basic HTML skeleton of the website.
- Within the <head> </head> tags add the following style definition.
- Inside the <body></body> tags add the following div tags.
- Place any content for the site between the <div> </div> tags.
- Finished product:
- Save your file with the extension .htm or .html and you're all done.Advertisement
Community Q&A
- QuestionCan a .css file be saved as .css, or it should be saved as .html?Community AnswerA .css file should be saved as a .css file, with no exceptions.
- QuestionCan a .css file be saved as .css, or it should be saved as .html? Actually you can add into the head of your HTML file and put your CSS there.AD DevelopersCommunity AnswerCSS files are different from HTML files. If you write your CSS code you should save it as CSS file with css as suffix. But if you write CSS code inside a HTML document you should save the document as HTML file with html or htm suffix. Just remember you can not include HTML tags or JavaScript tags in your CSS document.
- QuestionHow can someone create an image gallery?Free EagleCommunity Answer1.) Log into your websites cPanel. 2.) Click on Softaculous Apps Installer. 3.) Click on Image Galleries 4.) Choose a gallery to host your images. 5.) You will then be able to upload pictures to your gallery, and link to the gallery from your website. You will receive detail instructions with each gallery.
Video
Tips
- You can add background-color: color; to the body and centered style codes. If you use different colors for each you can create colored borders on the left and right.Thanks
- Play with the width until you reach the desired look.Thanks
Is this article up to date?
⚠️ Disclaimer:
Content from Wiki How English language website. Text is available under the Creative Commons Attribution-Share Alike License; additional terms may apply.
Wiki How does not encourage the violation of any laws, and cannot be responsible for any violations of such laws, should you link to this domain, or use, reproduce, or republish the information contained herein.
- - A few of these subjects are frequently censored by educational, governmental, corporate, parental and other filtering schemes.
- - Some articles may contain names, images, artworks or descriptions of events that some cultures restrict access to
- - Please note: Wiki How does not give you opinion about the law, or advice about medical. If you need specific advice (for example, medical, legal, financial or risk management), please seek a professional who is licensed or knowledgeable in that area.
- - Readers should not judge the importance of topics based on their coverage on Wiki How, nor think a topic is important just because it is the subject of a Wiki article.