HTML - Div Id And Class Alignment Question
Hey all,
First post here and new to HTML. I have a question regarding DIV ID alignment conflict with a CLASS alignment. I have a logo that I want aligned left (header ID) with the fade-in slide show script to be centered (DIV CLASS). Here's the code in question: <body> <div id="header"> <div align="left"><img src="images/logo1.jpg" width="500" height="133" alt="Orion Images" /> <div class="centerdiv"> <script type="text/javascript"> //new fadeshow(IMAGES_ARRAY_NAME, slideshow_width, slideshow_height, borderwidth, delay, pause (0=no, 1=yes), optionalRandomOrder) new fadeshow(fadeimages, 350, 275, 0, 4000, 1, "R") //new fadeshow(fadeimages2, 140, 225, 0, 3000, 0) </script> </div> </div> </div> <!-- end of header div --> <br /> CSS: #header, #content, #navigation, #footer { position: relative; } #content { top: 0%; width: 60%; left: 20%; font-family: "Trebuchet MS", Verdana, sans-serif; background-color:#000000; color: #C8C6F0; font-size:14px; font-style:italic; font-weight:lighter; } #navigation { left: 0; width:100%; } I'm new to this so maybe I'm overlooking the obvious or don't truly understand what I'm doing. I've done a search but didn't find an answer to my problem. Any help would be greatly appreciate. Thanks for everyone's time! Similar TutorialsIs there a way to position text? To try and be more specific, I don't want my text all the way to left, or right in the center. I kind of want it halfway. Thanks in advance! Hello, I am a page and was wondering how I would align it center in the page without all the formating being messed up. So I was wondering if there was a way to make everything center in the page but look just as it does now, just centered no matter the size of the page. Hope you can help! Thank you in advance. This is the page I would like the code to center http://www.primenewscenter.com/updat...ncom&buid=4928 Thanks! Hi everyone. I'm new at this, so I apologize if this is a simple or redundant question. I'm trying to create a website where the front page is comprised of 5 rollover image links that, when properly aligned (in this case to the right), form one cohesive image. I have tried to individually align each with align="right" but instead of a column of images aligned to the right and directly on top of each other with no spaces, they are instead being organized like text. In other words, the first image is to the right, than the next two span across the page because there is enough room, then the following two do the same. The result is a scattered and disjointed image. I hope that makes sense. How can I get them to stack to the right with no spaces in between? thanks for any help. Hi there I got a little problem with my website http://www.gone-surfing.com ; the thing is that I would like to have the waveforecast on the right side of the site, where there is currently only an empty black space. And I am simply wondering how this can be done? In a way which enables the waveforecast to progress downwards out there, without pushing the other tables / content downwards. Hope some clever minds can help me out here. Any suggestions? PS! I would like to keep the design like this, it would be a bit too much work changing the whole design due to my lack of webdesign skills. The source code is available here @ gone-surfing.com/index.html A big thanks in advance for any help or suggestions. All the best, Alex Hey guys, This is my first time here and I am VERY new to developing in HTML, CSS, JS etc. so please bear with me I am using W3Schools as my primary resource at the moment and have a question about the use of the class versus the ID attribute. On the W3Schools site it is stated that ID is intended for identifying a specific element and that the class attribute is intended to be used to identify multiple elements. But as you can simply apply the ID attribute (<div id="element1">) to ANY element, why have the two? Is the distinction between the two more about the fact that you can apply the class attribute to a particular tag type such as: p.blue {color: Blue;} Many thanks for your help with this. RezD BAH Just realised I have posted this in the wrong forum (great start) hopefully a moderator can move this? Thanks. I'm trying to make a website for class, and am having a problem. I made a table, but when I change the size of the window, the words wrap and distort. If I made the window big, the table stretches, and if I make it small it squishes up. What's the easiest way to fix this? This is the first site I've done. I want to add some screenshots to the center of the page but can't figure out how to keep the links in place at the left. When I add the pics the links move down to make room for the pics. How do I get the links to stay in place at the left of the screenshots? Thank you for any help. Krytin http://ghostfleet.bravehost.com/ghostfleet.htm Hey all, Just a question about my amature portfilio site that im creating. On some pages, graphics and blog, for example, http://www.freewebs.com/breakdowninc.../graphics.html http://www.freewebs.com/breakdowninc/pages/blog.html I am wanting to center the graphics/blog parts overhead of the copywrite text, found at the bottom of my page. Example: I have centered the graphics images, using align="center" yet they go off the side slightly. Anyway can how can I align them appropriately, without using "position:absolute" because it screws with the mini/maximising of my page. Cheers Hi Guys Here is some css I use for my footer, I want it to be centered but only span 98% of the distance, however when I change the width to 98% it only cuts off the 2% from the right hand side and justifies the footer to the left. Any Help? Thanks Code: #footer{ clear: left; width: 100%; background: white; color: black; text-align: center; padding: 2px 0; } Hi, I am trying to figure out how I can align text with an image using spacing (strictly HTML). I have applied the vspace and hspace tags to my image, but then my image won't be aligned flush with the text. Is there any way I can set up spacing on just one side of the image? It's not that huge of a deal because its only an under construction page... but I'd like to know how to get this page looking the same in both IE and Firefox. The only real issues with IE right now is that the image isn't centered and the yellow tape bg is 1px off from where it should be... thanks for any help! http://www.pzfantasyfootball.com Code: <html> <head> <title>PZ Fantasy Football » Under Construction</title> <style type="text/css"> * {margin: 0; padding:0;} p {margin-top: 15px;} h2 {font-size: 25px; border-bottom: 1px solid #fff; margin-bottom: 10px;} body { background-image: url(images/Metal_Texture-PhotoshopTower.jpg); background-color: #000; color: #fff; font-family: calibri, arial, verdana; } a, a:visited, a:active {color: #09f;} a:hover {color: #06c;} #wrap { width: 800px; margin: 0 auto; } .yellowtape { position: absolute; bottom: 0; width: 100%; height: 524px; background-image: url(images/yellowtapebg.gif); background-repeat: repeat-x; } .construction { position: absolute; bottom:0; background-image: url(images/pzfantasyfootballunderconstruction.jpg); width: 800px; height: 600px; } .text { position: relative; left: 300px; top: 225px; width: 500px; font-size: 18px; text-align: left; } </style> </head> <body> <div class="yellowtape"></div> <div id="wrap"> <div class="construction"> <div class="text"><h2>11/1/07 » Site Under Construction Again</h2>Well once again we enter construction mode. I just wasn't feeling the league site, no one really used it much, it didn't have much content that Yahoo! couldn't already offer, and it just really ended up being a waste of time. So now I'm going to give it a shot with a fantasy help site. I know I've done this before, but my future may hold something in the sports industry, so now I look to try and establish a well read site in order to help achieve my goals. I'm not 100% sure if the new site will be done before the end of this season, however it should be done in time for the 2008 NFL Draft. Hope to see you all soon! <p />Oh, and feel free to contact me via the forums <a href="http://www.pzfantasyfootball.com/forums">here</a>. </div> </div></body> </html> hey guys im getting a weird b0rder ar0und my <div>, i d0nt kn0w what it is..can anyb0dy help me please? ive been l00king at div pr0perties but i havent been able t0 eliminate that b0rder - im n0t even sure its fr0m the div but i'd think it is. the b0rder im talking ab0ut is the black 0ne. c0me t0 think 0f it.. its n0t a b0rder - the black secti0n is a <th> and the black is its backgr0und, but the <div> inside the <th> simply d0esnt extend in it t0 100% :/ http://www.hotlinkfiles.com/files/57...cument_7_.html Hope someone can suggest something. I am working with a programme that uses three templates to structure the web site, feeds articles, author page and site map on a daily basis to my web site. I attempted to insert Adsense ad units to templates and unfortunately everything is out of line now. this can be viewed at http://daviddutch.com/currency/articles/index.html Question is how do I bring everything else back in line please as when I look at coding there is no clear place to put the adsense HTML code to get things lined up correctly. Hope someone can offer wisdom and guidance. cheers Good morning, I cannot figure out how to get the images one on top of the other (in a straight line) here http://divamaggie.com/?p=60 . I tried Code: <br>, <p> and simply line spaces, but nothing seems to be working. I'm really hoping someone can tell me what I'm doing wrong. Hi All, I am pulling some data from MySQL and i need to display on screen with Left / Right Alignment. For The example <table width="85%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td> Now here i am looking if database-loc = left the data will go left side else it will go right side.\ pulling data from DB is okay with me. Now i am looking some idea how to format div so it shuld set accordingly. Currenly i tried the below but all go to the left. <div align="left">Left Line</div> <div align="left">Left Line</div> <div align="left">Left Line</div> <div align="right">Right Line</div> <div align="right">Right Line</div> <div align="right">Right Line</div> It is going in right side but it is down of left <div> it must go to the top with right direction some thing like valign="top" </td> </tr> </table> I hope i explain it well, i am sorry for my language. Hi there. I use the following code to show a swf file and align it vertically and horizontically but i can do only the horizontal alignment. Any help about the vertical? Thanks in advance HTML Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <title>Site</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-utf-8" /> <style type="text/css" media="screen"> body { margin:0; text-align:center; } div#content { text-align:center; vertical-align:middle;} object#content { display:inline; vertical-align:middle;} </style> <script type="text/javascript" src="swfobject.js"></script> <script type="text/javascript"> swfobject.embedSWF("main.swf", "myContent", "1400", "910", "9.0.0"); </script> </head> <body> <div style="vertical-align:middle"> <div id="myContent" style="vertical-align:middle"></div> </div> </body> </html> I don't understand! On my end when I upload it to the server and open an html file in the browser, everything looks fine. But when other people look at the site, it looks totally different. Text boxes are disgusting, I use CSS positioning and it puts everything totally off of the layout. I have a div which contains a line of text as a url. When clicked, a div is displayed directly below, and the content is different depending on the user. Currently, the div opens and two left hand sides align. I would like to cause the right hand sides to align instead, with the divs growing to the left if the text is larger. Is this possible? Hi, Can someone help me align the two images at the bottom of the html page (view attachment) in the center. It should be compatible with IE and Firefox 3. I have attached sample code in the .doc file. Thanks in advance, Ronnie |