HTML - Centering Image With Repeated Images!
Hello,
I have a question from the sample images that I've illustrated. How can I create a HTML page based on image above? I not good in HTML or CSS. I'm just a gfx designer. Can someone show me some basic code for this. Thanks in advanced. Similar TutorialsHello Everyone. The problem I am having and always wanted to know the correct way is . When adding text within a table with a background image and if the text excedes the background image thus increasing the height of the table, the background image repeats. What I want to do is have a solid color repeat at the bottom of the image so the table does not break the image, I want the image not to Repeat but to take on that solid color and repeat that color through the bottom of the Table so I can add as much text as I need. I appreciate any help. I know this is quite common when working with table. Thank! Hi all Normally in a style sheet I would use "background-repeat: repeat-x" but I was wondering if it is possible to do without CSS? Hello, I'm having real trouble aligning images to the 'exact' centre in different browsers. I'm using <div align="middle"> </div> around the whole code at the moment, which aligns horizontally in Chrome and Firefox, but not IE9. But even this does not vertically align as well. Afraid I don't know much about CSS or any other div tags. I built the site in Dreamweaver - this is the code straight from site: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <div align="middle"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>www.test.com</title> <style type="text/css"> <!-- body { background-color: #000; } --> </style></head> <body> <img src="comet3.jpg" width="933" height="658" border="0" align="middle" usemap="#Map" /> <map name="Map" id="Map"><area shape="circle" coords="885,123,9" href="comet2.html" /><area shape="circle" coords="916,124,9" href="comet4.html" /><area shape="rect" coords="785,71,904,103" href="contact.html" /><area shape="rect" coords="665,70,756,109" href="about.html" /> <area shape="rect" coords="371,73,462,112" href="index.html" /> <area shape="rect" coords="499,70,632,111" href="portfolio.html" /> <area shape="poly" coords="891,118" href="#" /> </map> </body> </html> </div> Really need some help with this! Thanks for any assistance Cheers J OK, just put my new site up etc. I'm just finishing it with images etc for my friends: http://bparch.freehostia.com/ When you look at the images on the front page, is there a way of centering them? Here is the CSS for the gallery: Code: ul#gallery { margin:0 auto; padding:0; list-style-type:none; width:90%; font-family: verdana, arial, helvetica, sans-serif; text-align: center; } ul#gallery li { float: left; margin:5px; text-align: center; } ul#gallery li p { text-align: center; margin:5px 0; } Here is the CSS for the other parts: Code: body { margin:0px; padding:0px; font-family:verdana, arial, helvetica, sans-serif; color:#333; background-color:#ccccff; } h1 { margin:0px 0px 0px 0px; padding:0px; font-size:28px; line-height:28px; font-weight:900; color:#666666; text-align: center; } h2 { font-size:22px; text-align: center; } p { font:11px/20px verdana, arial, helvetica, sans-serif; margin:0px 0px 16px 0px; padding:0px; } #Content>p {margin:0px;} #Content>p+p {text-indent:30px;} a { color:#09c; font-size:11px; text-decoration:none; font-weight:600; font-family:verdana, arial, helvetica, sans-serif; } a:link { color:#00009c;} a:visited { color:#00009c;} a:hover { color:#ccccff ; background-color:#FFFFFF; border-style:dashed; border-color:black; border-width:1px 0px } .headings { color: #000000; text-decoration: underline; font-size: 20px; font-weight: bold; } #Header { margin:50px 0px 10px 0px; padding:17px 14px 14px 20px; /* For IE5/Win's benefit height = [correct height] + [top padding] + [top and bottom border widths] */ height:33px; /* 14px + 17px + 2px = 33px */ border-style:solid; border-color:black; border-width:1px 0px; /* top and bottom borders: 1px; left and right borders: 0px */ line-height:11px; background-color:#eee; text-align: center; /* Here is the ugly brilliant hack that protects IE5/Win from its own stupidity. Thanks to Tantek Celik for the hack and to Eric Costello for publicizing it. IE5/Win incorrectly parses the "\"}"" value, prematurely closing the style declaration. The incorrect IE5/Win value is above, while the correct value is below. See http://glish.com/css/hacks.asp for details. */ voice-family: "\"}\""; voice-family:inherit; height:14px; /* the correct height */ } /* I've heard this called the "be nice to Opera 5" rule. Basically, it feeds correct length values to user agents that exhibit the parsing error exploited above yet get the CSS box model right and understand the CSS2 parent-child selector. ALWAYS include a "be nice to Opera 5" rule every time you use the Tantek Celik hack (above). */ body>#Header {height:14px;} #Content { margin:0px 50px 50px 200px; padding:10px; background-color:#eee; border:1px dashed #666666; } #Menu { text-align: center; position:absolute; top:110px; left:20px; width:172px; padding:10px; background-color:#eee; border:1px dashed #666666; line-height:17px; /* Again, the ugly brilliant hack. */ voice-family: "\"}\""; voice-family:inherit; width:150px; } /* Again, "be nice to Opera 5". */ body>#Menu {width:150px;} Thanks -- Chris Is there a way to center images of changing size, without using the <div align="center">? I have several images that I would like to center on a page with having to compute where the center is and then setting the margin to move it over. Thanks, Greg Hi All, I am newbie to website developing, would like to know if there is a way to avoid the repeated code on very page, so that coding could be easier. The main(index) page looks like, i have a top page and two other pages left and right with content in the center. --------------------------------------------------------------------------------------------- top page --------------------------------------------------------------------------------------------- | | Left Page| |Right Page | | __________________________________________________________ Is there a way to avoid writing code for top/left/right for every link I create in the website, is there a way to call from another file? Any help is highly appreciated..thank you. In my website, the navigation bar and logo are repeated at the top of every page. However, if I were to make a change to the navbar, I would have to implement that change on every page (50+). Is there a way I can change the code in one place, and have it change on every page? Thanks! I have the following HTML: <table id="TextArea1"> <tr> <td valign=top><img src="Images/AllProducts.jpg" alt="All Products" align=center></td> </tr> The image is placed at the top left corner of the table using the: valign=top Then, I want to center the image horizontally within the table using: align=center But, this markup is ignored. I have tried all the values for "align" and: align=right is the only one that works. What do I need to do to get this to work? Thanks. I would like to center three button images under an image. In the old day we would put our text into the image and create a two-row table, with the top row having one cell three columns wide and the bottom row having three cells. I have tried making my image with three uls with background images under them, but of course I can't force the full image to show since my content doesn't take up the full space. I am currently putting things in a table, just to make the full image show, but I feel like I'm still doing things old-school. Is there a newer, spiffier way to do this? table { width:780px; font-size:125%; padding:0; overflow:hidden; } td { width:254px; height:60px; background-repeat:no-repeat; background-position:top left; background-image:url(images/navbackground2.png); padding:0 0 0 20px; } Also my images won't justify. The space between the cells seems predetermined no matter what I futz with and there's a space to the right of the last image that I don't want. Finally, is there a way to put all three background statements into one code? (I know that's a CSS question, but I don't want to cross-post.) Elisabeth Hi all i have been trying to center a group of four images using html. the code is: PHP Code: <img src="tennis.jpeg"align="center"width="100" height="100" title="Equipment needed for playing tennis." > <img src="snooker.jpeg"align="center" width="100" height="100" title="Snooker table within a snooker club where you play the sport "> <img src="Golf.jpeg" "align="center"width="100" height="100 title="The Famous last hole on the old corse St Andrews"> <img src="Badminton.jpeg"align="center" width="100" height="100" title="Equipment needed for playing Badminton"> some how its not quite right any ideas where im going wrong? TI AV. Gaz. I tried every code I could find, but warning, I'm still new to HTML. This is my table code for now. I need the first row image to be centered. When i view it in a browser it is aligned to the left <table style="width: 635px; height: 900px" cellspacing="0" cellpadding="0" border="0"> <tbody> <tr> <td style="width: 600px; height: 600px;" colspan="6"><img alt="" src="breakfast1.JPG" /></td> </tr> <tr style="height: 100px"> <td><img alt="" src="bthumb1.JPG" /></td> <td><img alt="" src="bthumb2.JPG" /></td> <td><img alt="" src="bthumb3.JPG" /></td> <td><img alt="" src="bthumb4.JPG" /></td> <td><img alt="" src="bthumb5.JPG" /></td> <td><img alt="" src="bthumb6.JPG" /></td> </tr> <tr style="height: 100px"> <td><img alt="" src="bthumb7.JPG" /></td> <td><img alt="" src="bthumb8.JPG" /></td> <td><img alt="" src="bthumb9.JPG" /></td> <td><img alt="" src="bthumb10.JPG" /></td> <td><img alt="" src="bthumb11.JPG" /></td> <td><img alt="" src="bthumb12.JPG" /></td> </tr> <tr style="height: 100px"> <td><img alt="" src="bthumb13.JPG" /></td> </tr> </tbody> </table> Alright, this is an admittedly novice question but I haven't been able to figure it out yet and would love some help. I'm currently coding a website (my first, clearly) that will ultimately have a large number of pages. I understand the value of writing semantic code and pairing it with an external style sheet to make changes in design quick and easy across a website. My question is, how do you code common elements across the website (ie headers, navigation bars, footers, etc) so that making a change only once (such as adding a tab to the navigation bar) will change it across the site, without having to change the code on each individual page? I understand that you can do this with php, but it doesn't seem to be the common solution. Is there another way to accomplish this without php? Thanks in advance everybody! I created a table and on one side is an image and the other side words. I would like to center the image vertically and horizontally within the <td> tag. Right now the image is on the top of the area it's in This code I'm using now is.... <img src="http://www.elevatingyourbusiness.com/images/6 Step Process201x178.jpg" width="201" height="178" alt="6 Step Process Photo" /> For a better picture of how "lopsided" the picture/words look you can go to www.ElevatingYourBusiness.com It's the graphic under the title starting "World-Class Management " I'm open to any other suggestions you might have that will make this particular area look eye pleasing. Thanks in advance. Hello folks, I'm trying out some different background images sized 800 x 600, but I'm having trouble getting them to center on the page! The graphic is hugging the right hand side of the screen at a low resolution, and is off center, slightly to the right at a higher res. Here is a url to show you what is happening: http://www.magicalwonders.com/test/ The code is very basic: Code: <body bgcolor="#000000"> <div align="center"><img src="images/background.jpg" alt="background" width="800" height="600"> </div> Not sure what I'm missing out? Any advice would be appreciated. Many thanks, Myles I seem to be having trouble. I centered the main image fine but when it comes to centering the background image (http://www.leeryan.fan-sites.org/trylayout/back.png), i can't seem to work out what to do. http://www.leeryan.fan-sites.org/trylayout/header.php If anyone can help me out i would appreciate it...I hope i have posted this in the correct place...This is all the coding i have that seem to be to do with the back.png don't know if that helps, i'm not very good with this sort of thing. Code: <body topmargin=0 leftmargin=0 background="back.png"> http://www.cubedspacedesigns.com/imagegallery/ This page has a row of scrolling thumbnails along the bottom. Each thumbnail, when clicked on, changes the main image. My problem is that I can't get the main image to centre. The image itself is in a div called #image, and that is inside a container box called #imagebox. For some reason my #image div automatically takes on the width of its parent, #imagebox. What I want it to do is to take on the width of the new image and get centred inside its parent. What is the best method to center a single (hover over) image link in the absolute center of a browser page? I know there must be something very easy that's going over my head. Is it easiest via CSS, or html? or neither, or both??? here's my code so far Code: <!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>keep your eyes open</title> <style type="text/css"> <!-- #centerDIV { width: 100%; height: 100%; vertical-align: middle; text-align: center; } body { background-color: #333333; } --> </style> <script type="text/javascript"> <!-- function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc; } function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}} } function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); if(!x && d.getElementById) x=d.getElementById(n); return x; } function MM_swapImage() { //v3.0 var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} } //--> </script> </head> <body onload="MM_preloadImages('Images/eyesopen.png')"> <div id="centerDIV"> <a href="mailto:info@kyeonyc.com" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('eyes_closed','','Images/eyesopen.png',1)"><img src="Images/eyesclosed.png" alt="eyes open" name="eyes_closed" width="249" height="247" border="0" class="imageCenter" id="eyes_closed" /></a></div> </body> </html> I'm trying to create a button image in HTML. and I would like the the button to be 100 pixels left of the center of the page and 150 pixels from the top. I need it to work with different resolutions. This is what I tried which doesn't work. <img src="Banner/edv_banner.png" style="position:absoulte; top:130px; center:10;"> How do I go about centering an image in a table cell so it is centered in both IE and Firefox? Right now, when I use "center" tags, it will be centered in Firefox, but will be up against the left side in IE. Any help is appreciated! I am trying to create a page header that has an image on the left and text that should be centered, however the centering takes into consideration the image. I would like the centering to use the full width. Can this be done? http://www.toddcary.com/pvrc/test1/header.html |