Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Software Development
Programming
Tutorials
How to create a basic content container in HTML + CSS (Very Basic)
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Queef" data-source="post: 244349" data-attributes="member: 19889"><p>This tutorial is incredibly basic and should be something every person that can code basic html and css on here should know, sadly, they don't.</p><p></p><p>I usually wouldn't post something like this but I'm sick of seeing messy coding on templates where people have margined their content from the left and the right of the screen because they don't know how to make a simple container.</p><p></p><p>First off </p><p>[HTML]<div class="container"></p><p> (Your content here)</p><p></div></p><p>[/HTML]</p><p>As mentioned in the above code, place your html for the specific area you're trying to center in the div tags of the container class.</p><p></p><p>Then apply this style,</p><p>[CODE].container { width: 900px; margin: 0 auto; }</p><p>[/CODE]</p><p>You can change the width to whatever you like. The wider it is, the more spaced out and closer to the edges of the screen your content will appear.</p><p></p><p>Now, if theres a certain section in the page that you want to be wider for some reason you could easily do something like, </p><p>[CODE].container.wider { width: 1000px; }[/CODE]</p><p></p><p>and the HTML for that would be, </p><p>[CODE]<div class="container wider"></p><p></div>[/CODE]</p></blockquote><p></p>
[QUOTE="Queef, post: 244349, member: 19889"] This tutorial is incredibly basic and should be something every person that can code basic html and css on here should know, sadly, they don't. I usually wouldn't post something like this but I'm sick of seeing messy coding on templates where people have margined their content from the left and the right of the screen because they don't know how to make a simple container. First off [HTML]<div class="container"> (Your content here) </div> [/HTML] As mentioned in the above code, place your html for the specific area you're trying to center in the div tags of the container class. Then apply this style, [CODE].container { width: 900px; margin: 0 auto; } [/CODE] You can change the width to whatever you like. The wider it is, the more spaced out and closer to the edges of the screen your content will appear. Now, if theres a certain section in the page that you want to be wider for some reason you could easily do something like, [CODE].container.wider { width: 1000px; }[/CODE] and the HTML for that would be, [CODE]<div class="container wider"> </div>[/CODE] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Software Development
Programming
Tutorials
How to create a basic content container in HTML + CSS (Very Basic)
Top