chr2014 Posted October 20, 2014 Share Posted October 20, 2014 Hello, I would like to place images inside layers, and position each layer on a webpage with absolute positioning. Is this the best way to write to div? <div style="position:absolute; left:10px; top:500px; z-index:1;"><img src="http://website.com/image.gif" alt="image description" title=""></div> Thanks, Chris Link to comment Share on other sites More sharing options...
davej Posted October 20, 2014 Share Posted October 20, 2014 Why? Link to comment Share on other sites More sharing options...
dsonesuk Posted October 20, 2014 Share Posted October 20, 2014 When i hear mention of layers and position: absolute; in same sentence, I think Dreamweaver, IF so, don't! use margins, padding, float instead, you should never use position: absolute; for layout purposes you will only regret it in the end and have to redo it, I guarantee it. Link to comment Share on other sites More sharing options...
Ingolme Posted October 20, 2014 Share Posted October 20, 2014 The concept of "layer" is an old Netscape thing. The best way to style a div is with an external stylesheet, not inline styles. See the difference between external stylesheets and inline styles here: http://www.w3schools.com/css/css_howto.asp Link to comment Share on other sites More sharing options...
chr2014 Posted October 20, 2014 Author Share Posted October 20, 2014 Could you please re-write this div for me? <div style="position:absolute; left:10px; top:500px; z-index:1;"><img src="http://website.com/image.gif" alt="image description" title=""></div> Thanks, Chris Link to comment Share on other sites More sharing options...
davej Posted October 21, 2014 Share Posted October 21, 2014 A webpage usually consists of a variety of divs. The divs and other elements give the webpage its structure. See... http://www.w3schools.com/html/html_layout.asp Link to comment Share on other sites More sharing options...
dsonesuk Posted October 21, 2014 Share Posted October 21, 2014 Yea ok!<div style="left:10px; top:500px; z-index:1;position: absolute;"><img src="http://website.com/image.gif" alt="image description" title=""></div>Unless we know exactly what this does in relation to other layers, elements on your site, we can't really help adjusting your styling, as far as we know it could be perfectly ok, it does what you have styled it to do.As already mentioned you should not use inline styling, you should then look at the links provided, and apply the styling access (inline styling in <head>...</head> or external stylesheet)to your requirements. It seems to us you have made no attempt even looking at these links and just want US to just do the work for you. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now