Preemo
Members
-
Joined
-
Last visited
Reputation Activity
-
Preemo reacted to Samus in Need help centering 2 divsCSS
div.wrapper { margin: auto; }
-
Preemo reacted to Mikec1uk in Need help centering 2 divsAdding
margin:0 auto;
to the css of your wrapper div should do the trick.
-
Preemo reacted to mteam in How do I code this layout?You need to add a width for margin auto to work
add a height to #header-tile
#wrapper { margin: 0 auto; width:960px; } #header-tile { background: url(images/header_bar.png) repeat-x; height:50px; }
-
Preemo reacted to Alluziion in How do I code this layout?Ok say you have your basic layout you simply add the wrapper and empty divs as shown.
<html> <head> Head content here </head> <body> <div id="header-tile"></div><!-- SPREADS ACROSS --> <div id="wrapper"> <!-- start wrapper --><!-- ALL CENTERED --> <div id="header"> header content goes here such as your navigation. </div> <div id="main-content"> all your main content and other DIVs go here... </div> <div id="footer"> footer content here such as copyright </div> </div> <!-- end wrapper --><!-- ALL CENTERED --> <div id="footer-tile"></div><!-- SPREADS ACROSS --> </body> </html>
So when you center your #wrapper along with all your content using margin: 0 auto and a set width it won't effect the #footer-tile or #header-tile div's which means you can set them to width: 100% and give them a background image (repeat-x) and it will spread across the screen as necessary.
There may be an easier way but I have only made 1 website which is near completion and this method worked so haven't needed to try any alternatives yet.
If your still not too sure just make a new index.html and try it.
-
Preemo reacted to Alluziion in How do I code this layout?Their 2 CSS pages... (third is irrelevant)
http://www.bodhost.co.uk/css/style.css http://www.bodhost.co.uk/SpryAssets/SpryMenuBarHorizontal.css
To get the effect your after is simple.
You need to make a Wrapper DIV which holds the content of the Header, Body and Footer and apply margin: 0 auto; to it.
To get the Footer and Header to spread all the way across make 2 empty DIVs for example (one outside each end of the wrapper div) and put your header and footer graphic in the style for it. for example...
HTML
<div id="header-tile"></div> <div id="wrapper"> Content here..... </div> <div id="footer-tile"></div>
CSS
#wrapper { margin: 0 auto; } #header-tile { background: url(path/to/your/header/graphic.gif) repeat-x; } #footer-tile { background: url(path/to/your/footer/graphic.gif) repeat-x; }
usually try not spoon-feed this much but I remember when I first started off it was something I had trouble with.
There may be a better solution than using empty DIVs but never bothered to try anything else as of yet.
-
Preemo reacted to zed in Creating a header the same width as the siteget your pen/pencil out and then draw around all of it to create a 'wrapper' div.
-
Preemo got a reaction from Jo 90 in New-Look WDFI love it! Brilliant design!
-
Preemo reacted to andy9l in Having graphics as <div> cornersHTML:
<div class="content-wrapper"> <div class="content-top"><!-- Rounded Top --></div> <div class="content-title"><h2>Title Here</h2></div> <div class="content-body">Body of the content here</div> <div class="content-bottom"><!-- Rounded Bottom --></div> </div><!-- End Content Piece -->
CSS:
.content-wrapper {width:500px} .content-top {height:15px;background:url('link/to/rounded/corner/top/image.gif') no-repeat top;} .content-bottom {height:15px;background:url('link/to/rounded/corner/bottom/image.gif') no-repeat bottom;}
-
Preemo reacted to Bomb in Fixed website widthChange the 280% width of your header-right div to 440px.
Hope this helps.
-
Preemo reacted to andy9l in Fixed website widthCSS:
* {text-align:center;margin:0;padding:0;} .container {width:940px;margin:0 auto;}
HTML:
<html> <head></head> <body> <div class="container"> All of your website here... </div> </body> </html>
-
Preemo reacted to TylerCollins in Easier way for using the same codingNope, just refer to it only in the header file the same way you normally do.
-
Preemo reacted to andy9l in Easier way for using the same codingPHP includes.
inc.header.php
<div id="header"> <div id="header-content"> <div id="header-left" align="center"> <a href="index.php" ><img src="images/logo.png" border="0"></a> </div> <div id="header-right" align="center"> <br> <a href="http://www.facebook.com/pages/Laser-Web-Design/174877969215907" target="_blank"><img src="images/facebook.png"></a> <a href="http://twitter.com/#!/laserwebdesign" target="_blank"><img src="images/twitter.png"></a> </div> </div> </div>
inc.footer.php
<div id="footer"> ... etc. </div>
Each page:
<?php include('inc.header.php'); ?> <div id="page-content"> Your page here </div> <?php include('inc.footer.php'); ?>
-
Preemo reacted to pat24 in <div> on top of each otherJust add margin-left:40px; to your header left div in the css
40px is approx
-
Preemo reacted to pat24 in <div> on top of each otheradd margin:0 auto; to your #container in the css
-
Preemo reacted to Wickham in Having different content boxesYou code a container and then code four divs inside with float: left; width: ??px;
Make sure that the total widths of 4 divs plus their side margins, side padding and side borders total the width of the container.
CSS
#container { width: 1000px; overflow: hidden; } #div1, #div2, #div3, #div4 {float: left; width: 240px; padding: 5px; }/*240 + 2*5 = 250 x 4 = 1000*/
<div id="container"> <div id="div1">........</div> <div id="div2">........</div> <div id="div3">........</div> <div id="div4">........</div> </div>
-
Preemo reacted to Wickham in Having different content boxesYou haven't got a proper stylesheet, it's got html markup for 404 File Not Found instead of the CSS and your html file must have a doctype at the top before the <html> tag from here
http://www.w3.org/QA/2002/04/valid-dtd-list.html
-
Preemo reacted to mteam in Having different content boxesadd
margin:0 auto; to #container in the css