HTML - <p> Creating Unwanted Spacing Between <div> Sections
Hi,
Consider the following HTML code: HTML Code: <div style="background-color: blue"> <p> This is a paragraph </p> </div> <div style="background-color: green;"> <p> This is another paragraph </p> </div> The problem is, despite specifying background colors for the div sections, inevitably there's a white space between the two sections. Instead, I want the colored sections to be adjacent to one another, without any space in between, like adjacent cells of a table. I'm trying to be good and avoid using <table>'s as so many tutorials have encouraged, but I'm unsure how to accomplish this without them. I believe this is possible but does anyone know for sure? Thank you! Edit: If it makes a difference, it's sort of a requirement that the content within the div sections will be <p>-enclosed blocks of text. Similar TutorialsHey guys. I am in the middle of making a new Mod for vbulletin and I ran into a bit of a snag. If you go to www.chosen-wow.com/forumlist.php, you will see at the top that there is a "Raid Progression" table. In that table, you will see quite a few pictures with spaces between all of them. How do I make the space between each image in a row go away? In other words, what code am I missing from the table code below? Code: <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center"> <thead> <tr> <td class="tcat" colspan="2">Chosen Raid Progression</td> </tr> </thead> <tbody> <tr> <td class="alt1" width="50%"> <center><div class="progress_title">Karazhan</div> <img src="progression_mod/kz_1_dead.jpg" width="53" height="71"> <img src="progression_mod/kz_2_dead.jpg" width="48" height="71"> <img src="progression_mod/kz_3_dead.jpg" width="48" height="71"> <img src="progression_mod/kz_4_dead.jpg" width="48" height="71"> <img src="progression_mod/kz_5_dead.jpg" width="47" height="71"> <img src="progression_mod/kz_6_dead.jpg" width="48" height="71"> <img src="progression_mod/kz_7_dead.jpg" width="47" height="71"> <img src="progression_mod/kz_8_dead.jpg" width="47" height="71"> <img src="progression_mod/kz_9_dead.jpg" width="62" height="71"> <div class="progress_title">Serpentshrine Cavern</div> <img src="progression_mod/ssc_1_alive.jpg" width="53" height="71"> <img src="progression_mod/ssc_2_alive.jpg" width="48" height="71"> <img src="progression_mod/ssc_3_alive.jpg" width="48" height="71"> <img src="progression_mod/ssc_4_alive.jpg" width="48" height="71"> <img src="progression_mod/ssc_5_alive.jpg" width="47" height="71"> <img src="progression_mod/ssc_6_alive.jpg" width="48" height="71"> <img src="progression_mod/ssc_7_bkg.jpg" width="47" height="71"> <img src="progression_mod/ssc_8_bkg.jpg" width="47" height="71"> <img src="progression_mod/ssc_9_bkg.jpg" width="62" height="71"> <div class="progress_title">Mount Hyjal</div> <img src="progression_mod/mh_1_alive.jpg" width="53" height="71"> <img src="progression_mod/mh_2_alive.jpg" width="48" height="71"> <img src="progression_mod/mh_3_alive.jpg" width="48" height="71"> <img src="progression_mod/mh_4_alive.jpg" width="48" height="71"> <img src="progression_mod/mh_5_alive.jpg" width="47" height="71"> <img src="progression_mod/mh_6_bkg.jpg" width="48" height="71"> <img src="progression_mod/mh_7_bkg.jpg" width="47" height="71"> <img src="progression_mod/mh_8_bkg.jpg" width="47" height="71"> <img src="progression_mod/mh_9_bkg.jpg" width="62" height="71"> </center> <td class="alt1" width="50%"> <center><div class="progress_title">Outdoor & World</div> <img src="progression_mod/wld_1_dead.jpg" width="53" height="71" border="0"> <img src="progression_mod/wld_2_dead.jpg" width="48" height="71" border="0"> <img src="progression_mod/wld_3_alive.jpg" width="48" height="71"> <img src="progression_mod/wld_4_alive.jpg" width="48" height="71"> <img src="progression_mod/wld_5_alive.jpg" width="47" height="71"> <img src="progression_mod/wld_6_bkg.jpg" width="48" height="71"> <img src="progression_mod/wld_7_bkg.jpg" width="47" height="71"> <img src="progression_mod/wld_8_bkg.jpg" width="47" height="71"> <img src="progression_mod/wld_9_bkg.jpg" width="62" height="71"> <div class="progress_title">Tempest Keep</div> <img src="progression_mod/tk_1_dead.jpg" width="53" height="71"> <img src="progression_mod/tk_2_alive.jpg" width="48" height="71"> <img src="progression_mod/tk_3_alive.jpg" width="48" height="71"> <img src="progression_mod/tk_4_alive.jpg" width="48" height="71"> <img src="progression_mod/tk_5_bkg.jpg" width="47" height="71"> <img src="progression_mod/tk_6_bkg.jpg" width="48" height="71"> <img src="progression_mod/tk_7_bkg.jpg" width="47" height="71"> <img src="progression_mod/tk_8_bkg.jpg" width="47" height="71"> <img src="progression_mod/tk_9_bkg.jpg" width="62" height="71"> <div class="progress_title">Black Temple</div> <img src="progression_mod/bt_1_alive.jpg" width="53" height="71"> <img src="progression_mod/bt_2_alive.jpg" width="48" height="71"> <img src="progression_mod/bt_3_alive.jpg" width="48" height="71"> <img src="progression_mod/bt_4_alive.jpg" width="48" height="71"> <img src="progression_mod/bt_5_alive.jpg" width="47" height="71"> <img src="progression_mod/bt_6_alive.jpg" width="48" height="71"> <img src="progression_mod/bt_7_alive.jpg" width="47" height="71"> <img src="progression_mod/bt_8_alive.jpg" width="47" height="71"> <img src="progression_mod/bt_9_alive.jpg" width="62" height="71"> </center> </td> </tr> </tbody> </table> Thanks in advance. I want my header at top with a logo in a navagation bar at left and the main in the middle, i have this: HTML Code: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <head> <title>Platnium</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style type="text/css"> body {background-color: #555555} p {color: #ffffff} div {background-color: #000000} </style> <script type="text/javascript"></script> </head> <body> <div id="wrap"> <div style="text-align: center;" id="header"> <p> Header </p> <div id="left" style="text-align: left;"> <p> left </p> <div id="main" style="text-align: center;"> <p> main </p> </div> </div> </div> </div> </body> </html> But i want them in different sections. like if i was going to put them in tables. I have an <a> tag which when you hover has the background turn grey, but it only highlights the section around the text but I would like it to be a bigger area around it. Like having text centered in a table cell and whe you hover the background turns grey. Any ideas? Hi all New to this forum and pretty basic in html But how to i create links at the top of the page to move down the page to certain sections. Regards, Alan Able to handle html sample code I mean to say that when you make an image and want certain sections of it to link to one page and another section of it to link to another whats the code for this? I've been looking everywhere and can't find it anywhere Hiya, I was wondering if there's a way to make various sections of the image clickable? The sections on the image are not rectangular so I can't make divs. I don't think I can use imagemap either since that only works for making one clickable area right? I already cut out these sections in photoshop and saved them with alpha background, and created a "glowing" version of each section, since I want to make it so that when mouse hovers over it, it will glow. But I can't stack them on top of each other, since if I do that only the topmost layer will be clickable for those areas where they will overlap with rectangular divs. This is example of what I mean: Thanks Hey everyone! Does anybody know how we could set up google search results for this: ( see pic ) Hey, I'm having a couple of problems which I'm hoping some of you may be able to help me with. Basically the background for the website which I am working on has 3 sections; a top section, a blankl middle section, and a bottom section. I have therefore designed the site using 3 tables, each table containing one row and 3 columns. Each table has one of the backgrounds, such that: A. The background of the top table is the top background. B. The background of the middle table is the blank, plain white background. C. The background of the bottom table is the bottom background. This method seems to work, however when I first implemented this design non of tyhe backgrounds displayed, so to get round this I entered some <br></br> tags which succesfully caused the backgrounds to display suitably. I continues the web design in FF, and completed it. When I then viewed the finished article in IE there were 2 top backgrounds, on middle section, and 2 bottom backgrounds. I fear I may be totally missing the point here! Can anyone help me out please. Hi! I've looked it over and over ant I can't seem to find the solution to this. A huge space appears on my webpage without permission! Here is the code HTML Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <SCRIPT TYPE="text/javascript"> function popup(mylink, annonces) { if (! window.focus)return true; var href; if (typeof(mylink) == 'string') href=mylink; else href=mylink.href; window.open(href, annonces, 'width=600,height=600,scrollbars=yes'); return false; } // </SCRIPT> <TITLE>Duo: balalaika et piano -- Dmitri Nassyrov et Victoria Khramova</TITLE> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; Charset=Windows-1251"> <META NAME="GENERATOR" CONTENT="Microsoft FrontPage 5.0"> <META NAME="Author" CONTENT="Dmitri Nassyrov"> <META NAME="KeyWords" CONTENT="balalaika, Victoria, Khramova, Dmitri, Nassyrov, concerts, piano, duo, stringsandkeys, douce, soiree, histoire, du, balalaika"> <META NAME="Description" CONTENT="Le duo du balalaïka et du piano: Dmitri Nassyrov et Victoria Khramova, ont un repertoire tres varié: folklorique, classique, jazz, et autres... "> <TITLE>Duo:balalaïka et piano - Dmitri Nassyrov et Victoria Khramova</TITLE> <link rel="stylesheet" type="text/css" href="style.css" /> </HEAD> <div id="container"> <BODY BGCOLOR="#000000" TEXT="#000000" LINK="#0000FF" VLINK="#7F007F" ALINK="#FF0000" BACKGROUND="../img/bcknd.jpg" bgproperties="fixed"> <script language="javascript"> var u=13200; var vsbl=0; var l=''; </script> <script type="text/javascript" language=Javascript src="http://h1.hitslog.com/counter.js"></script> <script language="javascript"> document.write('<a href=http://hitslog.com/><img border=0 width=1 height=1 src=http://h1.hitslog.com/hl.php?'+l+'></a>'); </script> <noscript> <a href="http://hitslog.com/"><img border=0 width=1 height=1 src="http://h1.hitslog.com/hl.php?u=13200" alt="MySpace tracker"></a></noscript> <TABLE id="main"> <tR width=720 height=160> <td valign=top width=615 height=160><IMG width=615 height=160 alt="Duo: balalaïka et piano - Dmitri Nassyrov et Victoria Khramova" SRC="../site/IMG/HEADER2.gif"> </td> <td> <table valign=center width=105 height=75 cellpadding=0> <tr class="lang"> <img alt="En Français" border=0 src="../site/img/francaisclik.gif" > </tr> <tr class="lang"> <a href="../eng/index.html"><img alt="In English" onmouseover="this.src='../site/img/englishon.gif'" onmouseout="this.src='../site/img/english.gif'" onclick="this.src='../site/img/englishclik.gif'" border=0 src="../site/img/english.gif"></a> </tr> <tr class="lang"> <a href="../rus/index.html"><img alt="По-Русски" onmouseover="this.src='../site/img/russianon.gif'" onmouseout="this.src='../site/img/russian.gif'" onclick="this.src='../site/img/russianclik.gif'" border=0 src="../site/img/russian.gif"></a> </tr> <tr width=100 height=85> <img alt="Duo: balalaïka et piano - Dmitri Nassyrov et Victoria Khramova" src="../site/img/sideheader.gif"> </tr> </table> </td> </tR> <!--The big space is here--> <TR> <td colspan=2> <table width=720> <tr> <td valign=top> <TABLE valign=top> <TR> <TD class="menu"><A HREF="INDEX.HTML"><img src="../img/bienvenueclik.gif" alt="Bienvenue" border="0"></a></TD> </TR> <TR> <TD class="menu"><A HREF="DUO.HTML"><img src="../img/leduo.gif" alt="Notre duo" onmouseover="this.src='../img/leduoon.gif'" onmouseout="this.src='../img/leduo.gif'" onclick="this.src='../img/leduoclik.gif'" border="0"></A></TD> </TR> <TR> <TD class="menu"><A HREF="concerts.HTML"><img src="../img/concerts.gif" alt="Nos concerts" onmouseover="this.src='../img/concertson.gif'" onmouseout="this.src='../img/concerts.gif'" onclick="this.src='../img/concertsclik.gif'" border="0"></A></TD> </TR> <TR> <TD class="menu"><A HREF="audio.HTML"><img src="../img/audio.gif" alt="Notre musique" onmouseover="this.src='../img/audioon.gif'" onmouseout="this.src='../img/audio.gif'" onclick="this.src='../img/audioclik.gif'"border="0"></A></TD> </TR> <TR> <TD class="menu"><A HREF="historique.HTML"><img src="../img/historique.gif" alt="L'Histoire du balalaïka" onmouseover="this.src='../img/historiqueon.gif'" onmouseout="this.src='../img/historique.gif'" onclick="this.src='../img/historiqueclik.gif'" border="0"></A></TD> </TR> <TR> <TD class="menu"><A HREF="liens.HTML"><img src="../img/liens.gif" alt="Liens" onmouseover="this.src='../img/lienson.gif'" onmouseout="this.src='../img/liens.gif'" onclick="this.src='../img/liensclik.gif'" border="0"></A></TD> </TR> <TR> <TD class="menu"><A HREF="contact.HTML"><img src="../img/contact.gif" alt="Comment nous rejoindre" onmouseover="this.src='../img/contacton.gif'" onmouseout="this.src='../img/contact.gif'" onclick="this.src='../img/contactclik.gif'" border="0"></A></TD> </TR> </TABLE> </tD> <TD VALIGN=top> <table id="text" height=100% width=500 cellpadding=20 style="BACKGROUND: url('../site/img/textbcknd.jpg'); "> <tr> <!--<marquee id="test" onMouseOver="document.all.test.stop()" onMouseOut="document.all.test.start()" scrollamount="2" scrolldelay="20" width="100%" height="51" behavior="scroll" direction="left"><font face="arial" align=middle><i> <A HREF="annonces3.html" onClick="return popup(this, 'annonces',true)"><b>17 novembre - 20:00</b></A><br> Festival "From Russia With Love"<br> à la bibliothèque publique juive. </i></font></marquee>--> </tr> <tr> <td valign=top> <font face="times new roman" size=3> <h2>Un duo, c'est indivisible...</h2> <p align=justify>Dans un duo, le rôle de chaque musicien n'est pas seulement de compléter son partenaire, mais aussi de souligner la sonorité de son instrument.</p> <p align=justify>Notre duo est assez particulier et assez unique à Montréal. Les deux instruments composant notre duo sont: le piano et le balalaïka - instrument folklorique russe. Les possibilitées de cette union sont surprenantes, dans le répertoi folklore, classique, jazz...</p> <hr width=95%></hr> <p>Sur ce site, vous trouverez de l'information sur nos <A HREF="concerts.HTML">concerts</A>, vous pourrez écouter nos <A HREF="audio.HTML">enregistrements</A>, lire nos <A HREF="DUO.HTML">biographies</A>, et plus encore.</p> <p>Et, bien sûr, nous serons heureux de vous voir à nos concerts!</P> <p><i>Dmitri Nassyrov et Victoria Khramova</i></p> </TD> </tr> </table> </td> </tr> </table> </td> </TR> </TABLE> <font face="arial" size=1 align=right> &nb sp; &nb sp; &nb sp; Dmitri Nassyrov et Victoria Khramova © Tous droits réservés.</font> </BODY> </div> </HTML> I put "The big space is here" where the space occurs. The weird thing is that if I open the file in some html editing software (frontpage), it looks fine, but once I open it in IE, the space appears. Here is the style.css file if it needs checking: HTML Code: body { text-align: center; background-color: rgb(239,197,137); } #container { margin: 0 auto; } #main { border:0px; /* border="0" */ border-collapse:collapse; /* cellspacing="0" */ } #top { border:0px; /* border="0" */ border-collapse:collapse; /* cellspacing="0" */ } tr.lang { horizontal-align:left; width:100px; height:25px; } td.menu { width:220; height:40; } table { border-collapse:collapse; } #text { padding:20px; } Any help is appreciated. Thank you for your time! I'm quite new to HTML and have only just started using Div tags as oppose to large tables to produce websites, i only do this for fun and they don't go on the net. As for my problem, the div tag that contains the main content of the page has moved below the navigation bar and i want it to be sat to the right of it... Will you need the coding for the website? It looks like this.. Header Nav bar Main content Footer I want it to be like.. Header Nav bar | Main content Footer It had been like this, and i'm not sure why it changed.. Thanks in advance for any help. =] ~Josh. This is my very first post on this forum, so please, be gentle with me. I write my websites in HTML code but recently I seem to have created an anomaly that I cannot get to the bottom of. If you pop over to this page: http://website.lineone.net/~barrybboor/tirol58.html you will see a very large space below the 'FULL RESULT' line and the start of the result table. According to the coding I have, there shouldn't be any such space but I can see no reason for it and cannot find a way to reduce it. Can anyone help a poor elderly novice, please? I inserted a SWF inside a table and it should fit perfectly. However, the table streches a bit and makes the background repeat for a couple of pixels which totally screws the layout. Here is my website: http://jlcq.uuuq.com/jl.html I'm talking about the two horizontal lines on each side of the banner. It looks like the SWF has some kind of margin. How can i delete it so it fits perfectly? If you have the time take a look at my code or download the site and find a way to modify the code so that it fits. Note that the problem also occurs if I insert an image in the same spot instead of a SWF. Thanks! Hey everyone, I was wondering how I can get rid of a scrollbar that only shows up in IE, when I embedded another webpage inside a webpage. I specified size and the other webpage is only a few lines of text so it doesn't need to scroll to see everything. I don't have this problem in FF. HTML Code: <object data=siteupdates.html width="100%" height="212"> </object> Thanks Hi guys, I would like to block visitors from certain websites and if possible display a message that my website is no longer available. Please help me with this. It's crucially important. Thanks in advance I've been writing all of my HTML in notepad since I started, and Id really like to keep it that way, but the browser seems to treat line breaks (in notepad) between elements as a space character in certain instances. For example, say I have HTML Code: <img1><img2> <img3> <img4> in the browser, that will render every image on the same line, but with a physical white space between img2, img3, and img 4 example: [1][2] [3] [4] in the past ive just sucked it up and put everything on the same line, but in larger projects that gets messy very quickly... any input that i'snt "use something better" is appreciated, thanks. Hi there, I'm a bit of a noob to HTML, and I'm working on creating a site for my webcomic. The main portion of the layout has a simple table with a header and footer at the top and bottom rows. It's supposed to look like Instead it looks like The code for the table is this: Quote: <table align="center" cellpadding="0" cellspacing="0" border="0" width="725"> <tr> <td width="725" valign="bottom" border="0"> <img src="/images/header.png" width="725" height="33" /></td> </tr> <tr> <td width="725" bgcolor="0099CC" align="center"> <p>***todays_comics***<p>***first_day*** ***previous_day*** ***next_day*** ***last_day*** </td> <tr> <td width="725" valign="top" border="0"> <img src="/images/footer.png" width="725" height="33" /></td> </tr> </table> Whenever I put the code into an HTML test bed, it works fine, but for some reason refuses to work when I upload it to my FTP. It's driving me crazy. If you could help, I'd really appreciate it. Thanks. Hey; I'm trying to build this menu in a table. Each row has an image, which I'm using for a rollover. Altogether, the table should be 202 x 285 pix. The problem is, 5 pixels of blank space are being added under every image, (in the same row as the image), and I'm not sure why. Altogether, it's making my table 45 pix too large. Any help would be appreciated. HTML: <div id="menu"> <table border="0" cellpadding="0" cellspacing="0"> <tr><td ><img alt="Home" src="images/regHome.jpeg" /></td></tr> <tr><td><img alt="Program Information" src="images/regInformation.jpeg" id="Image2" onmouseover="MM_swapImage('Image2','','images/rollOverInformation.jpeg',1)" onmouseout="MM_swapImgRestore()" /></td></tr> ...etc</table></div> CSS: #menu { margin: 0 auto; text-align: left; color: #000000; font-family:Arial; position:relative; float:left; font-size: 18px; top:144px; !top:140px; height:271px; !height:100px; _height:100px; width:202px; !width:10px; _width:10px; float:left; background-color:#00FF00; } www.artdied.com I've created this website using frames and am now getting lines appearing at the edges of the frames on the bottom and right side when the browser window is at certain sizes. I have no idea clue what's causing it or how to get rid of it. Any ideas? Much thanks! Hi, I have a problem. some of my HTML text appears differently in the browsers. for e.g - I want my text to show normally like this - Hi My name is raj. BUT on the browser it is showing as Hi M Y na me is r aj. How do I get rid of the unwanted space. Pease help somebody and thanks in advance (",) |