AndyCanfield Posted September 13, 2011 Share Posted September 13, 2011 I am frustrated because this: <div style='width:400px:height:150px;border:1px solid blue'>...</div> does not give me a 400 by 150 pixel region on the page.(the 'border' could be background-color; it's just there toshow the region boundaries.) <div> always seems to be page width.The best I can get is with <td> (table cell),which will be no bigger than the enclosed contents. I want a "box" into which I can put thingsand those things will be inside the boxand the box will be around those thingswith the specified size.Exclusive - nothing else on the page will be inside the box(<\<div><img align='left' eats contents way past the </div>)! Is this even possible with HTML and CSS ? Link to comment Share on other sites More sharing options...
Drycodez Posted September 13, 2011 Share Posted September 13, 2011 <div style='width:400px :height:150px; border:1px solid blue'>...</div>NB: correct the part marked with red. EDIT: you shouldn't be using an apostrophe (') to enclose html attribute's value(s), use quotation (") instead! Link to comment Share on other sites More sharing options...
Ingolme Posted September 13, 2011 Share Posted September 13, 2011 It makes no difference whether one uses an apostrophe or a quotation mark on HTML attributes, the specification indicates that both are equally valid. Link to comment Share on other sites More sharing options...
TheGallery Posted September 13, 2011 Share Posted September 13, 2011 <div style='width:400px:height:150px;border:1px solid blue'>...</div> You got mistakes in your code You don't use a semicolon in the first and the last properties. Try fixing those like below: <div style='width:400px; height:150px; border:1px solid blue;'>...[/color][/color]</div> Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.