Rianna
04-10-2006, 07:36 AM
Hi, what code do I add to keep an image closest or furthest away from the side of a web page. In html code please. Thanks! Ri.
|
Click to See Complete Forum and Search --> : Formating the images closer to the edges of web page, help. Rianna 04-10-2006, 07:36 AM Hi, what code do I add to keep an image closest or furthest away from the side of a web page. In html code please. Thanks! Ri. skilled1 04-10-2006, 04:07 PM <DIV id=content style="Z-INDEX: 1; LEFT: 0px; RIGHT: 0px; WIDTH: *px; POSITION: absolute; TOP: 69px; HEIGHT: *px"> <img src="image path"> </div> this will force it to be exactly where you want it otherwise, learnight <tables> is a great idea felgall 04-10-2006, 04:40 PM Using tables for layout is a terrible idea. The stylesheet solution is the way to go but the above example has missing quotes and also everything should be lowercase. Also using absolute positioning is a bad idea unless you want to animate that part of the content. Adding the following line to your stylesheet will allow you to put things right up to the edge: body, html {margin:0;padding:0;} Rianna 04-10-2006, 07:39 PM Man, ok thanks. Stephen, you said, "unless you want to animate that part of the image." It is an animated image, do your specifications change? Stephan, do I put the margin location where the image first is inserted? What is padding in this instance for? Appreciated, Ri. Rianna 04-10-2006, 07:42 PM Skilled1 can you please correct your missing quoted and if he won't after a time, will someone else? Otherwise am I save with everything being lowercase, because I do have a few tables on my page that need some images in them. Ri. Rianna 04-10-2006, 08:20 PM Skilled1, your code almost worked but something not quite right, it moves the image down too far on the page even if I inserted it on the page where I want it. The image part worked fine but which part of the code can I alter for its table or page positioning? Stephen yours looked fine on my preview but when I pulled it up in IE the image was replaced with only a small red x and moved to another position. Any ideas for how to fix this? Thanks always fellas, Ri. Rianna 04-11-2006, 04:28 AM Forget about if for now, I spent all day setting up my pages a new way to hopefully fix the problem. It sounds like my pages shouldn't be doing this. Ri pcthug 04-11-2006, 04:55 AM Stephen's example is correct, and is 100% compatible with animated images. <html> <head> <style type="text/css"> body, html {margin:0;padding:0;} </style> </head> <body> <img src="foobar.gif" alt="I will appear within 0px of the edge of the page" /> </body> </html> Rianna 04-11-2006, 10:45 PM Great, your all gems, Ri Rianna 04-11-2006, 10:48 PM Forgot, pcthug, for just html without the Css, how do I adjust your code? Thanks felgall 04-12-2006, 03:00 AM For positioning you use CSS. HTML is for content only and says nothing about where to put anything - you can't position anything with HTML as there are no commands that modern browsers understand that handle positioning or anything to do with the appearance of the page. HTML only allows you to define the content of your page, not how to display it - for that we have CSS. If you use 15 year old HTML codes to try to position things in your web page then it will only work properly in Netscape 3 and Internet Explorer 3 and earlier (and I think it is some years since anyone used either of those browsers). Use the right tool for the right job. Rianna 04-12-2006, 03:53 AM OK, I admit the css and html gets me haywired. Sometimes I lump the two together since css has so much to do with html. If you answer me this, I will understand more. PCthug put a css command in and you didn't. I believe that is probably because Stephen your pages have css at the top of your web pages elsewhere. To show that your whole web pages have css commands. Or do I have to do like PC did and put css in wherever I am positioning something? Thanks, Ri felgall 04-12-2006, 04:49 AM I put <link rel="stylesheet" href="inc/master.css" type="text/css" /> at the top of all my web pages and then put the CSS into a separate file called master.css in the inc sub-directory. That way the same CSS gets applied to all of the 1000+ pages on my site instead of having to be hard coded into each page. If I decide to move the ads from one side of the page to the other I change one line of the CSS file and that changes all the pages at once. My answer earlier had the line of CSS code that PCthug quoted along with the necessary HTML to add it into a single page. To apply it to all of your pages you are better off with an external file for the CSS. Rianna 04-12-2006, 05:27 AM Very nice, thanks for the insite. One thing is certain its going to be a bit before I figure all that out so right now I have to do it the hard way. So can I just insert css code on my html page source codes as I need it? So far I have built several web pages just using mostly html and a few web page editors. skilled1 04-12-2006, 08:29 PM sorry for the long delay <DIV id=content style="Z-INDEX: 1; LEFT: *px; RIGHT: *px; POSITION: absolute; TOP: 69px; BOTTOM: *px;"> <img src="image path"> </div> if you want the bottom left, the mremove the code segments for top and right, and replace the * with how many pixels you wish it to be from the border of the window. webdeveloper.com
Copyright WebMediaBrands Inc., All Rights Reserved. |