gli Posted June 26, 2008 Share Posted June 26, 2008 Why, when i add doctype in my code, pictures are showing in their original size, not like i set at css ??? <!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"> <html> <head> <link rel="stylesheet" rev="stylesheet" href="styles.css" /> <script type="text/javascript" src="skript.js"></script> <style type="text/css"> <!-- #apDiv1 { position:absolute; left:205px; top:16px; width:200px; height:100px; z-index:1; color: red; } --> </style> </head> <body onLoad="goRightTime(), fadeOutTime()"> <div id="apDiv1"><a href='one.html'>this is one</a></div> <a id="linkleft" href="#" onClick="goLeft(), stopInterval(), fadeout(), fadeout2()"></a> <div id="boxLeft"><img id="imgLeft" src="images/0.gif" alt="imgleft"></img></div> <div id="boxMid"><img id="imgMid" src="images/one.gif" alt="imgmid"></img></div> <div id="boxRight"><img id="imgRight" src="images/two.gif" alt="imgright"></img></div> <a id="linkright" href="#" onClick="goRight(), stopInterval()"></a> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/112095-solved-doctype-forcing-pictures-on-their-original-size/ Share on other sites More sharing options...
ToonMariner Posted June 26, 2008 Share Posted June 26, 2008 you have not set the dimensions of any images in your css - indeed nor should you - you should use the width and height attributes within the mark up to do this.... Quote Link to comment https://forums.phpfreaks.com/topic/112095-solved-doctype-forcing-pictures-on-their-original-size/#findComment-575544 Share on other sites More sharing options...
gli Posted June 27, 2008 Author Share Posted June 27, 2008 you have not set the dimensions of any images in your css - indeed nor should you - you should use the width and height attributes within the mark up to do this.... I writed dimensions in <img> tag and img size is now working, but img border lost to, and position is now in other place. Why doctype changes so much. css: img#imgleft { width: 100px; height: 80px; border: 1px solid red; } img#imgright { width: 100px; height: 80px; border: 1px solid red; } img#imgmid { width: 200px; height: 100px; border: 1px solid red; margin-left: 4px; margin-top: 5px; } Quote Link to comment https://forums.phpfreaks.com/topic/112095-solved-doctype-forcing-pictures-on-their-original-size/#findComment-575925 Share on other sites More sharing options...
gli Posted June 27, 2008 Author Share Posted June 27, 2008 ouh, i found the problem. Yes probles was in css. Picture id is imgMid but in css imgmid with lowercase, and etc.! Thanks ! Quote Link to comment https://forums.phpfreaks.com/topic/112095-solved-doctype-forcing-pictures-on-their-original-size/#findComment-575928 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.