Images not showing up in IE 9 - html
Ok so I'm nearly done creating my first website. However it doesn't seem to run well in IE. It runs fine in Firefox and Chrome. The background loads but the main problem is that the picture links seem broken? Any help would be greatly appreciated.
My site: ngkevin-art.com
CSS:
body {
width:auto;
height:auto;
background-image:url(images/bg_main2.png);
background-color:#2d2d2d;
background-repeat:no-repeat;
background-position:center;
margin-top:30px;
}
#container {
width:1280px;
height:960px;
margin-left:auto;
margin-right:auto;
}
#wrapContact {
width: 520px;
height: 100px;
margin-left:735px;
margin-top: 10px;
clear: both;
}
#linked {
float:left;
margin-top:35px;
width: 175px;
}
#facebook {
float:left;
width: 200px;
margin-left:32px;
margin-top:25px;
}
#email {
float:left;
width:75px;
margin-left:35px;
margin-top:20px;
}
#wrapNav {
width: 475px;
margin-left:750px;
margin-top:60px;
}
#wrapCharacters {
width: 960px;
z-index: 3;
margin: 130px auto auto 75px;
float:left;
}
.turntable {
margin: .5% auto auto auto;
}
#zanza {
float:left;
}
#titan {
float:left;
margin-left: 10px;
}
#rockBeast {
float:left;
margin-left: 10px;
}
HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Kevin Ng Art Portfolio</title>
<script type="text/javascript"
src="http://code.jquery.com/jquery-latest.min.js" charset="utf-8">
</script>
<link rel="stylesheet" type="text/css" href="default3.css"/>
<script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.8.18.custom.min.js"></script>
<script type="text/javascript" src="js/jquery.smooth-scroll.min.js"></script>
<script type="text/javascript" src="js/lightbox.js"></script>
<link href="lightbox.css" rel="stylesheet" />
</head>
<body>
<div id="container">
<div id="wrapContact">
<div id="linked">
<a href="http://www.linkedin.com/pub/kevin-ng/25/558/75b">
<img src="images/logo_linked_large.png" width="auto" height="auto" border="0" alt="linkedin_logo" /> </a>
</div>
<div id="facebook">
<a href="http://www.facebook.com/profile.php?id=1309131548">
<img src="images/logo_fb_large.png" width="auto" height="auto" border="0" alt="facebook_logo" /> </a>
</div>
<div id="email">
<a href="mailto: ngkevin.3dartist#gmail.com">
<img src="images/gmail.png" width="auto" height="auto" border="0" alt="email_icon" /> </a>
</div>
</div> <!-- End "wrapContact"> -->
<div id="wrapNav">
<a href="index.html">
<img src="images/bg_tab_main.png" width="auto" height="auto" border="0" alt="Main" /> </a>
<a href="demo.html">
<img src="images/bg_tab_demo.png" width="auto" height="auto" border="0" alt="Demo" /> </a>
<a href="about.html">
<img src="images/bg_tab_about.png" width="auto" height="auto" border="0" alt="About" /> </a>
</div>
<!-- End "wrapNav"> -->
<div id="wrapAbout">
<div id="picture">
<img src="images/picture.jpg" width="auto" height="auto" alt="picture" />
<div id="text2">
<h2> Me in the middle left, my buddies, Jordan Gabriel on the left and Edmund Zhu on the right,
and finally, Epic Games VIP, Cliff Bleszinski! Taken at GDC 2010. </h2>
</div>
</div>
<div class="text">
<h1> Resume: <br/>
<br/> Email: <br/> <br/>
<br/> About Me:</h1>
</div>
<div class="text3">
<h1> Click Here
<br/> <br/> ngkevin.3dartist#gmail.com <br/>
<br/> <br/> <font size="4">
My desire to be in the game development industry is to work with other individuals that take pride in creating a game,
something that can be enjoyed by a multitude of people. There is nothing I would like better than to lend my talents and
artistic skills for that purpose. <br/> <br/>
I believe the key to creating memorable game art, whether it be characters or environments, is the story.
Just like reading a good book or watching a thrilling movie, I loved to be immersed in the world of the game. As a result,
I had an affinity to Role-Playing Games. Classic games of my generation such as Chrono Trigger, Final Fantasy, and Zelda
showed me a world of endless imagination. <br/> <br/>
The characters which are the focal point of the story, their goals and motivations, their trials and tribulations,
their victories and defeats... These are the things I think about constantly when I look at them.
A character without depth doesn't exist, but if they do, I can only imagine how boring that would be.
</font></h1>
</div>
</div>
</div><!-- End "container" -->
</body>
</html>
It's the width/height attributes on your images that are causing the problem. You have the width and height set to "auto". Either set an explicit width/height:
<img src="zanza/zanza_portrait_top.png" width="179" height="198" border="0" alt="zanza">
or remove the width and height attributes:
<img src="zanza/zanza_portrait_top.png" border="0" alt="zanza">
IE is messing up the image width and height. I'm sorry that I can't help more, but removing the height and width elements of each image makes the images show up for me.
Refer to this link about the auto property in CSS3. Basically, it is not supported in that version so it's better if you explicitly set it or do without the property.
Link
Related
How to place text completely below image
I have a quick question, when I try to style my image in this example, the text doesn't go down in its own line? How can I do that without adding many br's, is there a easier way to do this? I DO NOT WANT TO EDIT ON THE IMAGE STYLE (thats the whole point of this question) JS Fiddle link: https://jsfiddle.net/3vy8p6fx/ How do I get the "Staff" to be its own line? <strong>History</strong><br /> <br /> <strong>Mission</strong><br /> <br /> <strong>Leadership</strong> <div class="image123"> <div class="imgContainer"> <a href="http://nssc-test.berkeley.edu/leadership/vujic/"> <img src="http://nssc-test.berkeley.edu/wp-content/uploads/2015/03/Vujic-150x150.jpg"> </img> </a> <p align="center"> Jasmina Vujic <br>Principal Investigator </p> </div> <div class="imgContainer"> <a href="http://www.nuc.berkeley.edu/karl-van-bibber"> <img style="Padding-left: 5%;" src="http://nssc-test.berkeley.edu/wp-content/uploads/2015/03/KarlVan-Resized-150x150.jpg"> </img> </a> <p align="center"> Karl Van Bibber <br>Executive Director </p> </div> <div class="imgContainer"> <a href="http://nssc-test.berkeley.edu/leadership/vujic/"> <img style="Padding-left: 5%;" src="http://nssc-test.berkeley.edu/wp-content/uploads/2015/03/Bradley_M_Sherrill-150x150.png"> </img> </a> <p align="center"> Bradley Sherill <br>Deputy Exec Director </p> </div> <div class="imgContainer"> <a href="http://nssc-test.berkeley.edu/leadership/vujic/"> <img style="Padding-left: 5%;" src="http://nssc-test.berkeley.edu/wp-content/uploads/2015/03/Vetter-150x150.jpg"> </img> </a> <p align="center"> Kai Vetter <br>NNSA Liaison </p> </div> <div class="imgContainer"> <a href="http://nssc-test.berkeley.edu/leadership/vujic/"> <img style="Padding-left: 5%;" src="http://npwg.berkeley.edu/wp-content/uploads/2014/05/Leadership-Bethany-Goldblum.png"> </img> </a> <p align="center"> Bethany Goldblum <br>Associate Director </p> </div> </div> <br> <b>Staff:</b> css: .imgContainer { float: left; }
In your fiddle, simply adding the following will resolve your issue: .image123 { overflow: auto } That being said, I would refactor this a bit to use something like flexbox. I took the liberty to rework your fiddle a bit to reflect better semantics, and more organized styling. Fiddle: https://jsfiddle.net/3vy8p6fx/3/ The following material was in response to the original code provided by the OP. This is because the image is positioned absolutely to the viewport, thus removed from the flow of the layout, overlapping the paragraph. Also, the image element is self-closing, thus </img> is not needed. Furthermore, paragraphs are already block elements. So your inline styles are not needed. Remove all styles, and you'll have the effect you're desiring. <!DOCTYPE html> <head></head> <body> <img src="w3css.gif" /> <p>This is a heading.</p> </body> </html> If you must have the image positioned absolutely, at the top of the document, you can give the <body> itself some additional padding to push the contents (the <p> in this case) down further: <!DOCTYPE html> <head> <style> body { padding-top: 150px; } img { top: 0; left: 0; position: absolute; width: 100px; height: 140px; } </style> </head> <body> <img src="w3css.gif" /> <p>This is a heading.</p> </body> </html>
just change your .imgContainer { float: left; } TO .imgContainer { display: inline-block; } DEMO: https://jsfiddle.net/3vy8p6fx/2/ NOTICE: i changed some html syntax too, like: instead of <img ...></img> i do <img ... /> break tags <br> to <br/> ...etc. look to my DEMO!
cannot make my data in small centerd gray boxes
This is the beginning of my html: <html xmlns="http://www.w3.org/1999/xhtml"> <head> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css"></link> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap-theme.min.css"></link> <script type="script" src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script> </head> <body> <h1>Delta Fresh Samples:</h1> <p>save date: 08:23:11 31-May-02015</p> <div class="jumbotron" id="distance_small"> <h3>distance small</h3>0_1 <br> <a href="http://livemap-tiles1.waze.com/tiles/internal?lineGeom=(-71.1208,42.3317,-71.1052,42.3261,-71.0872,42.3354,-71.0570,42.3295,-71.0376,42.3394),(-71.1208,42.3317,-71.0754,42.3311,-71.0617,42.3428,-71.0376,42.3394),(-71.1208,42.3317,-71.0675,42.3525,-71.0376,42.3395)"> <img alt="missing livemap" src="http://livemap-tiles1.waze.com/tiles/internal?lineGeom=(-71.1208,42.3317,-71.1052,42.3261,-71.0872,42.3354,-71.0570,42.3295,-71.0376,42.3394),(-71.1208,42.3317,-71.0754,42.3311,-71.0617,42.3428,-71.0376,42.3394),(-71.1208,42.3317,-71.0675,42.3525,-71.0376,42.3395)" height="100" width="200"> </a> <br><span> </span>editor:<span><a title="0_0" href="https:/www.waze.com/editor/?lon=-71.1181994930557&lat=42.33211431130898&zoom=4&segments=66182276,22523498,22542379,69798169,70183731,70136684,22526478,77571254,77571249,83969671,83969602,83969601,83969300,83969562,83969306,83969308,83969311,83969444,22950508,22946295,63734947,63734946,22945044,76103782,61849159,22943314,22945842,22949040,76952893,22958740,22955108,22963930,22963937,61487751,78453835,78453836,78190323,78190322,22966401,22963938,22955881,22952772,22942713,22945900,61574081,22948993,22946660,61574071,67889632,67889631,67889637,22942168,22941119,22939556,22945627,61704033,63784515,69051844,61704023,22959771,78100291,78100305,78100306,75676668,22959690,22947454,22940596,22961456,22958490,22948978,22961457,22963582,65496487,22946251,22964699,74195770,75079286,22964701,22965880,62248964,78100492,78100491,22962630,22951570,22948096,22954294,66161229,66147839,22960015,22949762,22945545,22946824,22951606,22951605,22948122,22946840,22960419,22965961,22960420,22962680,22962685,22962684,22962683,22947641,22961812,22964726,22965877,22965967,22965964,22951601,22946847,22949797,75206339,75206338,22962702,22960433,22948128,22960544,22966245">alt 0</a></span><span><a title="0_1" href="https:/www.waze.com/editor/?lon=-71.1181994930557&lat=42.33211431130898&zoom=4&segments=66182276,22523498,22542379,69798169,70183731,70136684,22526478,77571254,77571249,83969671,83969602,83969601,83969300,83969562,83969306,83969308,83969311,83969776,83970667,83970668,83970679,83970678,83969787,83969884,83969791,83969889,83969965,62003149,22966553,22966554,22946589,22954701,22948771,22960706,22952457,22952456,69823920,67646833,22956976,22942713,22945900,61574081,22948993,22946660,61574071,67889632,67889631,67889637,22942168,22941119,22939556,22945627,61704033,63784515,69051844,61704067,61704043,22957408,61704040,72391451,72391452,61724192,61975137,61975144,57602828,61541078,22965716,22949679,22964912,22943804,22965887,22943805,81603700,81603658,22960396,22960397,22965904,22959154,22965764,22964822,22946555,22954865,22962698,22949797,75206339,75206338,22962702,22960433,22948128,22960544,22966245">alt 1</a></span><span><a title="0_2" href="https:/www.waze.com/editor/?lon=-71.1181994930557&lat=42.33211431130898&zoom=4&segments=66182276,22523498,22542379,69798169,70183731,70136684,22526478,22551059,22540619,22540617,22521289,22531355,22531357,22523497,77460394,77460392,61690687,67007203,67007202,22959509,22952362,22947304,22946552,73617242,77749675,73617397,22961888,22941066,62110860,83482398,83482876,83482875,22946605,74542235,83482565,83482564,61713972,74882174,74882173,69051742,61975892,65179805,65179806,61713939,77541139,77541140,61975883,22952799,61539504,57601394,22959961,22947692,22959735,22958946,22958947,22958607,22951490,22961077,22964301,22954627,22946241,22963491,76369581,22950499,22966864,22965699,22949657,22962492,22962497,22962496,22946416,22948460,22951483,22948007,22946064,22951140,61459698,22957970,22965738,22954249,22954934,22960321,78858435,22958543,69824727,69824726,22945987,22945859,67102730,77869444,77869443,22966245">alt 2</a></span> <br> </div> <div class="jumbotron" id="distance_large"> <h3>distance large</h3>0_0 <br> <a href="http://livemap-tiles1.waze.com/tiles/internal?lineGeom=(-71.1208,42.3317,-71.1052,42.3261,-71.0872,42.3354,-71.0570,42.3295,-71.0376,42.3394),(-71.1208,42.3317,-71.0754,42.3311,-71.0617,42.3428,-71.0376,42.3394),(-71.1208,42.3317,-71.0675,42.3525,-71.0376,42.3395)"> <img alt="missing livemap" src="http://livemap-tiles1.waze.com/tiles/internal?lineGeom=(-71.1208,42.3317,-71.1052,42.3261,-71.0872,42.3354,-71.0570,42.3295,-71.0376,42.3394),(-71.1208,42.3317,-71.0754,42.3311,-71.0617,42.3428,-71.0376,42.3394),(-71.1208,42.3317,-71.0675,42.3525,-71.0376,42.3395)" height="100" width="200"> </a> <br><span> </span>editor:<span><a title="0_0" href="https:/www.waze.com/editor/? and this is the result: I wanted to created boxes in the center of the page. I saw twitter bootstrap example (this example) but I cannot make class "jumbotron" center my data in medium size gray boxes. what am i missing? In Addition, if i would want to style this without twitter bootstrap how would you advise me to do this?
you can achieve that with some styling like this: html <h1>Delta Fresh Samples:</h1> <p>save date: 08:23:11 31-May-02015</p> <div class="jumbotron" id="distance_small"> <h3>distance small</h3>0_1 <br> <a href="http://livemap-tiles1.waze.com/tiles/internal?lineGeom=(-71.1208,42.3317,-71.1052,42.3261,-71.0872,42.3354,-71.0570,42.3295,-71.0376,42.3394),(-71.1208,42.3317,-71.0754,42.3311,-71.0617,42.3428,-71.0376,42.3394),(-71.1208,42.3317,-71.0675,42.3525,-71.0376,42.3395)"> <img alt="missing livemap" src="http://livemap-tiles1.waze.com/tiles/internal?lineGeom=(-71.1208,42.3317,-71.1052,42.3261,-71.0872,42.3354,-71.0570,42.3295,-71.0376,42.3394),(-71.1208,42.3317,-71.0754,42.3311,-71.0617,42.3428,-71.0376,42.3394),(-71.1208,42.3317,-71.0675,42.3525,-71.0376,42.3395)" height="100" width="200"> </a> <br><span>editor:</span><span><a title="0_0" href="https:/www.waze.com/editor/?lon=-71.1181994930557&lat=42.33211431130898&zoom=4&segments=66182276,22523498,22542379,69798169,70183731,70136684,22526478,77571254,77571249,83969671,83969602,83969601,83969300,83969562,83969306,83969308,83969311,83969444,22950508,22946295,63734947,63734946,22945044,76103782,61849159,22943314,22945842,22949040,76952893,22958740,22955108,22963930,22963937,61487751,78453835,78453836,78190323,78190322,22966401,22963938,22955881,22952772,22942713,22945900,61574081,22948993,22946660,61574071,67889632,67889631,67889637,22942168,22941119,22939556,22945627,61704033,63784515,69051844,61704023,22959771,78100291,78100305,78100306,75676668,22959690,22947454,22940596,22961456,22958490,22948978,22961457,22963582,65496487,22946251,22964699,74195770,75079286,22964701,22965880,62248964,78100492,78100491,22962630,22951570,22948096,22954294,66161229,66147839,22960015,22949762,22945545,22946824,22951606,22951605,22948122,22946840,22960419,22965961,22960420,22962680,22962685,22962684,22962683,22947641,22961812,22964726,22965877,22965967,22965964,22951601,22946847,22949797,75206339,75206338,22962702,22960433,22948128,22960544,22966245">alt 0</a></span><span><a title="0_1" href="https:/www.waze.com/editor/?lon=-71.1181994930557&lat=42.33211431130898&zoom=4&segments=66182276,22523498,22542379,69798169,70183731,70136684,22526478,77571254,77571249,83969671,83969602,83969601,83969300,83969562,83969306,83969308,83969311,83969776,83970667,83970668,83970679,83970678,83969787,83969884,83969791,83969889,83969965,62003149,22966553,22966554,22946589,22954701,22948771,22960706,22952457,22952456,69823920,67646833,22956976,22942713,22945900,61574081,22948993,22946660,61574071,67889632,67889631,67889637,22942168,22941119,22939556,22945627,61704033,63784515,69051844,61704067,61704043,22957408,61704040,72391451,72391452,61724192,61975137,61975144,57602828,61541078,22965716,22949679,22964912,22943804,22965887,22943805,81603700,81603658,22960396,22960397,22965904,22959154,22965764,22964822,22946555,22954865,22962698,22949797,75206339,75206338,22962702,22960433,22948128,22960544,22966245">alt 1</a></span><span><a title="0_2" href="https:/www.waze.com/editor/?lon=-71.1181994930557&lat=42.33211431130898&zoom=4&segments=66182276,22523498,22542379,69798169,70183731,70136684,22526478,22551059,22540619,22540617,22521289,22531355,22531357,22523497,77460394,77460392,61690687,67007203,67007202,22959509,22952362,22947304,22946552,73617242,77749675,73617397,22961888,22941066,62110860,83482398,83482876,83482875,22946605,74542235,83482565,83482564,61713972,74882174,74882173,69051742,61975892,65179805,65179806,61713939,77541139,77541140,61975883,22952799,61539504,57601394,22959961,22947692,22959735,22958946,22958947,22958607,22951490,22961077,22964301,22954627,22946241,22963491,76369581,22950499,22966864,22965699,22949657,22962492,22962497,22962496,22946416,22948460,22951483,22948007,22946064,22951140,61459698,22957970,22965738,22954249,22954934,22960321,78858435,22958543,69824727,69824726,22945987,22945859,67102730,77869444,77869443,22966245">alt 2</a></span> <br> </div> <div class="jumbotron" id="distance_large"> <h3>distance large</h3>0_0 <br> <a href="http://livemap-tiles1.waze.com/tiles/internal?lineGeom=(-71.1208,42.3317,-71.1052,42.3261,-71.0872,42.3354,-71.0570,42.3295,-71.0376,42.3394),(-71.1208,42.3317,-71.0754,42.3311,-71.0617,42.3428,-71.0376,42.3394),(-71.1208,42.3317,-71.0675,42.3525,-71.0376,42.3395)"> <img alt="missing livemap" src="http://livemap-tiles1.waze.com/tiles/internal?lineGeom=(-71.1208,42.3317,-71.1052,42.3261,-71.0872,42.3354,-71.0570,42.3295,-71.0376,42.3394),(-71.1208,42.3317,-71.0754,42.3311,-71.0617,42.3428,-71.0376,42.3394),(-71.1208,42.3317,-71.0675,42.3525,-71.0376,42.3395)" height="100" width="200"> </a> <br><span>editor:</span><span><a title="0_0" href="https:/www.waze.com/editor/?"></a> </div> css: .jumbotron{ background:#ddd; width:220px; margin:0 auto; } .jumbotron img{ display:block; margin:0 auto; } .jumbotron a,.jumbotron span{ display:inline-block; margin-left:10px; } see this fiddle
.jumbotron{ position : relative; margin: 0 auto; } and for being in one line use display: inline-block
Divs not auto resizing height inside another div
The solution has been found. The code is below. Thank you to everyone who helped. The Solution was to clear the float, the code below fixed it for me. .div#content:after { content:""; display:table; clear:both; } Thanks Again. Original Question I have 2 Divs, one being "Content" where all the content of my site is in. And another div named "updates". I want the div "content" to resize its height so that all the divs inside of it and fit. Here's an image explaining my problem easier Imgur Link, Not high enough rep to post image directly. Here's my full source code (html) (along with the css of content div and updates div. <html> <head> <link rel="stylesheet" type="text/css" href="css/reset.css"> <link rel="stylesheet" type="text/css" href="css/style.css"> <title>MCSocial</title> <script type="text/javascript" src="src/jquery-1.11.1.min.js"></script> <script type="text/javascript" src="src/jquery.tinycircleslider.js"></script> </head> <body> <div id="container"> <div id="content"> <nav> <ul class="nav"> <li class="left">MCFish</li> <li>Home</li> <li>News</li> <li>Members</li> <li>Media</li> </ul> </nav> <a href="#"><div id="block"> <img src="img/mojang.jpg" height="200px" width="850px"> </div></a> <a href="#"><div id="block"> <img src="img/minecraft.jpg" height="200px" width="850px"> </div></a> <div id="updates"> <img src="img/update.png" height="48px" width="140px"> <!--post updates here--> <h3 class="sub-title">Update 1.5</h3> <p class="list">Added a new homepage! More simple to navigate! Enjoy!<br>Please send me some feedback here!</p> <h3 class="sub-title">Update 1.4</h3> <p class="list">Cleaned up code!</a></p> <h3 class="sub-title">Update 1.3</h3> <p class="list">Added new themes! Check them out!</a></p> <h3 class="sub-title">Update 1.2</h3> <p class="list">Renamed Site: from MinecraftFishing to MCFish!</a></p> <h3 class="sub-title">Update 1.0</h3> <p class="list">Site goes LIVE!</p> <!--end post updates--> </div> <div id="twitter"> <img src="img/twitter.png" height="48px" width="140px"><br><br> <a class="twitter-timeline" href="https://twitter.com/FluffyRabbitzZ" data-widget-id="544642022154723328">Tweets by #FluffyRabbitzZ</a> <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script> </div> <div id="footer"> <p>©2014. MCSocial. All Rights Reserved.</p> </div> </div> </div> </body> </html> and the CSS; div#content { width: 900px; margin-left: auto; margin-right: auto; background-color: #fff; height: auto; border-radius: 2px; min-height: 100%; position: relative; } div#updates { float: left; margin-left: 2.6%; } Thanks for any help.
You should clear the float. Add overflow CSS property (for example :auto) to the div#content. A solution for modern browsers : .div#content:after { content:""; display:table; clear:both; }
You have to clear the floating content: <div style="clear:both"></div> before closing yout div.content.
Correctly Aligning Images with HTML and CSS
I'm currently in the process of creating a HTML/CSS layout for a Kiosk-style site. However, I am having a few issues making the alignment of the images and text to work exactly how I want. The logo and header should be fixed in the same place across every page, whereas I might need to expand the amount of buttons on-screen. Here is the illustration of an example: Example Image, where: Black box represents logo Blue boxes represent individual buttons Current HTML: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <link rel="stylesheet" type="text/css" href="style.css"> <html> <body background="background.png"> <div id="logo"> <img src="logo.png"> </div> <br> <div id="icons1"> <img src="button-wmcweb.png"></a> </div> <div id="icons1"> <img src="button-appointments.png"></a> </div> <div id="icons1"> <img src="button-prescriptions.png"></a> </div> <br> <div id="icons2"> <img src="button-somccg.png"></a> </div> <div id="icons2"> <img src="button-patient.png"></a> </div> <div id="icons2"> <img src="button-nhschoices.png"></a> </div> </body> </html> CSS: body { text-align:center; } #mainContainer { margin:0 auto; } #icons1 { display: inline-block; } #icons2 { display: inline-block; } Is using inline blocks the best practice for what I'm trying to achieve? Any help would be much appreciated.
I have created for you a JSFiddle with what you want as a starting point. Click for the full screen mode for the fiddle. There is the full code below for the ease of referencing. index.html: <!DOCTYPE html> <html> <head> <link rel="stylesheet" type="text/css" href="style.css"> </head> <body background="background.png"> <div id="logo"> <div id="logoimg"> <img src="http://cs614926.vk.me/v614926650/93b6/n9S5OGKt8L0.jpg" /> </div> <div id="logotext">lorem ipsum</div> </div> <div class="row"> <a href="http://stackoverflow.com/"> <img src="http://cs614926.vk.me/v614926744/752f/eY60jo6aYo4.jpg" /> </a> <a href="http://stackoverflow.com/"> <img src="http://cs614926.vk.me/v614926744/752f/eY60jo6aYo4.jpg" /> </a> <a href="http://stackoverflow.com/"> <img src="http://cs614926.vk.me/v614926744/752f/eY60jo6aYo4.jpg" /> </a> </div> <div class="row"> <a href="http://stackoverflow.com/"> <img src="http://cs614926.vk.me/v614926744/752f/eY60jo6aYo4.jpg" /> </a> <a href="http://stackoverflow.com/"> <img src="http://cs614926.vk.me/v614926744/752f/eY60jo6aYo4.jpg" /> </a> <a href="http://stackoverflow.com/"> <img src="http://cs614926.vk.me/v614926744/752f/eY60jo6aYo4.jpg" /> </a> </div> </body> </html> style.css: body { text-align: center; } #logoimg, #logotext, .row > img { display: inline; } #logo, .row { margin: 30px 10px; min-width: 1000px; } #logotext { min-width: 320px; vertical-align: top; font-size: 36px; padding: 0 20px; } img { width: 320px; resize: noresize; } a:link { text-decoration:none; } For more info on HTML/CSS, consider checking the following w3school tutorials: HTML and CSS.
Your HTML was wrong in a few places. No opening <a> tag, multiple id's with the same name, and the <link> for the css needs to be inside the <head></head> tags, as shown below. <head> <link rel="stylesheet" type="text/css" href="style.css"> </head> Is this what you're looking to achieve? http://jsfiddle.net/Q8gVL/
My CSS style sheet only affected 3 out of my 4 pages. How do I update that 4th page?
My main problem here is that I have one .css stylesheet hooked up to 3 page because this really is just forming a template for the time being until I can decide how I want each page to look individually. I preformed some div positioning on the website and I think it looks nice and centered on most of the pages...most. I have one page that is hooked up to the correct style sheet and will change anything I add to the style sheet, except where some divs won't shift on this one page. Here is a screenshot of a page that works: Click here And one that doesn't: Click here If you look closely, you are can see that my links are shifted more to the upper-right corner and so are my main content sections. The other two links that are used in this website look the same as the working page, by the way. CODING (Warning, there may be a tad unnecessary code there, but the coding is exactly the same on all websites except for the img src attributes, so there is no reason that all page wouldn't look the same): Page that works: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Teens For Antarctica Preservation</title> <link href="template.css" rel="stylesheet" type="text/css" /> </head> <body> <div class="header"><div style="margin-left:200px;"> <img src="images/logo_2.jpg" width="600" style="padding-top:12.5px;" /> </div> </div> <div> <p><a id="firstlink" href="index.html">TAP</a> <a id="rollover" href="whatis.html">Who is TAP</a> <a id="rollover" href="why.html">Why we do it</a> <a id="rollover" href="resources.html">Resources</a></p> <p> </p> </div> <p> </p> <p> </p> <img id="image" src="images/14_Seal2.jpg" /> <!-- TemplateEndEditable --> <!-- TemplateBeginEditable name="main="Main" content="Content"" --><p id="main">Main Content</p> <div id="footer"><p id="pfoot" style="vertical-align:bottom;">Teenspace and Teens For Antartica Preservation Inc. <br />Web Desinger: Mathew Crogan</p></div> </body> </html> This is the code for the website that doesn't work: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Who is TAP?</title> <link href="template.css" rel="stylesheet" type="text/css" /> </head> <body> <div class="header"><div style="margin-left:200px;"> <img src="images/logo_2.jpg" width="600" style="padding-top:12.5px;" /> </div> <div> <p><a id="firstlink" href="index.html">TAP</a> <a id="rollover" href="whatis.html">Who is TAP</a> <a id="rollover" href="why.html">Why we do it</a> <a id="rollover" href="resources.html">Resources</a></p> <p> </p> </div> <p> </p> <p> </p> <img src="images/14_Teens.jpg" id="image"/><!-- TemplateEndEditable --> <!-- TemplateBeginEditable name="main="Main" content="Content"" --><p id="main">Main Content</p> <div id="footer"><p id="pfoot" style="vertical-align:bottom;">Teenspace and Teens For Antartica Preservation Inc. <br />Web Desinger: Mathew Crogan</p></div> </body> </html> And here is my CSS stylesheet: #charset "utf-8"; /* CSS Document */ .header { height: 150px; width: 100%; margin-left: 25px; margin-right: 50px; position:relative; left:0px; top:0px; } html { width: 1000px; height: 650px; background-color:#D7D7FF; } a#rollover:link, a#rollover:visited { display:block; font-weight:bold; color:#FFFFFF; background-color:#B8B8B8; width:120px; text-align:center; padding:4px; text-decoration:none; border:1px solid #000; float:left; margin-top:30px; } a#rollover:hover, a#rollover:active { background-color:#A7A7A7; } a#firstlink:link, a#firstlink:visited { display:block; font-weight:bold; color:#FFFFFF; background-color:#B8B8B8; width:120px; text-align:center; padding:4px; text-decoration:none; border:1px solid #000; float:left; margin-top:30px; margin-left:265px; } a#firstlink:hover, a#firstlink:active { background-color:#A7A7A7; } #image { height:230px; width:300px; float:left; border: 3px solid #B5B5B5; margin-left:150px; margin-top:10px; border-radius:25px; box-shadow:10px 10px 6px #A3A3A3; } #main { height:250px; width:450px; border:3px solid #B5B5B5; margin-left:500px; margin-top:15px; border-radius:25px; box-shadow:10px 10px 6px #A3A3A3; padding-left:10px; padding-top: 6px; font-family: Georgia, "Times New Roman", Times, serif; font-weight:400; background-color:#FFF; } #footer { height:100px; bottom:0px; text-align:center; width:100%; padding-top:100px; padding-left:25px; } #pfoot { margin-left:50px; } Please provide any insite on how to fix this problem.
Working <div class="header"> <div style="margin-left:200px;"> <img src="images/logo_2.jpg" width="600" style="padding-top:12.5px;" /> </div> </div> Not working <div class="header"> <div style="margin-left:200px;"> <img src="images/logo_2.jpg" width="600" style="padding-top:12.5px;" /> </div> On the not working version, you've missed out the closing div for 'header'
I see, your html code is not the same. 1st document <body> <div class="header"><div style="margin-left:200px;"> <img src="images/logo_2.jpg" width="600" style="padding-top:12.5px;" /> </div> </div> <div> and the second document: <body> <div class="header"><div style="margin-left:200px;"> <img src="images/logo_2.jpg" width="600" style="padding-top:12.5px;" /> </div> <div> the second document is not correct, as you forgot to close the second div.