CSS - Resizing And Moving Divs Just Dragging And Dropping
Hi,
Is there any app or way to resize or change the position of the divs just dragging and dropping? Something like in Inkscape for resizing or moving objects. Ciao Similar TutorialsGot a problem in ie6 with divs dropping and a slight over lap in ie7. The tables are set width inside a 600px wide div but no matter what i do the columns on the right keep dropping. anyone have any ideas? how can i post screenshots when no urls allowed? Alright guys. I'm working on a horizontally scrolling news ticker type deal. I have two divs on screen, and the rest are off screen using the overflow:hidden on the parent. The divs are set to 466px wide, float:left, and the parent is 932px wide. Since div 3 and up are all 466px, they drop down below the other two. Not a problem, since the overflow is set. However the jquery animation does not reset the reference point when it scrolls, so the divs stay in this arrangement. Is there any way to keep them all lined up next to eachother horizontally? I'm wondering if there is a CSS solution first, before I get creative with the jQuery. I could easily set it for the next two divs to display right, but there is no telling how many divs there will be and it would quickly become a nightmare trying to account for all possibilities. Here is the current CSS I'm using: Code: #test {background-color:#F1F2F2; width:932px; padding:10px; margin-top:20px;overflow:hidden; display:inline-block; height:400px;} #newswrapper {height:100px; position:relative; left:0px;} #newswrapper div {float:left; position:relative; background:#CCC; width:466px; height:400px;} I developed http://technology-sleuth.com by testing in Firefox and Opera as I am on linux and at the time didn't have access to IE. All is fine in those browsers. However, in IE I see that when the page get too narrow, instead of narrowing the center div, it moves it below the rest of the page. As the center div is the one with the content, this is unacceptable. How can I prevent this? This site as you see it now was 'shortened' so that the center div does not get pushed down in the 800*600 screen resolution. So you will need to make the browser window very narrow to see the effect. But the problem is still visible. Thanks in advance. Dotan Cohen Hi - I have been using xhtml coding for most of my web projects this year, thankfully they have been pretty simple. I have a new one, the client has requested it be xhtml compliant. I was not consulted during the design phase, so i have been give the task of programming a very table centric layout. Can all designs be rendered with div's instead of tables? I have a diagram of the structure of a template page and I am not sure how to go about tackling it. Do i start with each individual section? I just need a little push and confimation the below layout is doable in css/divs... Thanks So, I have a div for content that contains three other divs for a three column display, like this: Code: <div id="content"> <div id="col1" class="column">filler filler filler</div> <div id="col2" class="column">filler filler filler</div> <div id="col3" class="column">filler filler filler</div> </div> now my CSS looks like this: Code: #content { top:10%; height: auto; background:#009999; border-width:thin; border-style:solid; border-color:#003333; overflow:hidden; } .column { position:absolute; top: 0%; width: 30.66%; display:block; } the problem is that the content div isn't resizing to fit the column divs. It's just a tiny thin strip at the top. It is also not hiding any of the column divs, it shows all of them. If I change height to, say, 200px it resizes to that value, and if I put text directly into that div (as opposed to the text in the column divs) it resizes to fit that. Any help/ideas would be greatly appreciated, thanks. Hi all, So i have been trying to get the divs with the content in to sit properly on IE6 they work correctly in firefox and ie 7 and 8. Originally the text div and the news bar div were both moved far down the page. I removed the height setting on the text div and it moved it back into (about) the correct place. But I cant figure out what is causing the news div to move, any advice would be greatly appreciated Code: <body> <div id="main" style="position:absolute; width:850px; background-image:url(images/4560-background_midext_02.jpg); left:15%; z-index:1;"> <div id="topborder"><img src="images/4560-bkground_top.jpg" /></div> <?php include('components/Header.php'); ?> <div id="body" style="position:relative; left:10px; top:10px; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;"> <?php include('components/logodisplay.php'); ?> ******THIS DIV IS THE ONE WHICH IS MOVING****** <div id="newsbanner" style="position:relative; left:10px; top:7px; z-index:1; display:block;"> <script type="text/javascript"> AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','560','height','60','title', 'newsbanner','src','flash/news','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','flash/news' ); //end AC code </script> <noscript><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase= "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="560" height="60" title="newsbanner"> <param name="movie" value="flash/news.swf" /> <param name="quality" value="high" /> <embed src="flash/news.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="560" height="60"></embed> </object></noscript> </div> <div id="sponsorshipenquiries" style="position:relative; left:20px; top:20px; z-index:1; <?php echo $enquiry; ?> " > <img src="images/header_sponsorship.jpg" /> <div id="text" style="top:10px; width:533px;"> Sponsorship provides a prime opportunity for your company to enhance its visibility and corporate presence during the conference. In addition to the intrinsic benefits of each option, all sponsorships include the opportunity to present a paper, full recognition on all promotional materials as an official sponsor and complimentary delegate places. All sponsorships are sold on a first come first served basis. Options can be reserved for a period of 10 working days.<br /><br /> <img src="images/header_sponsorshipoptions.jpg" /> <br /><br /> <img src="images/gr_platinum.jpg" /> <br /><br /> <img src="images/gr_gold.jpg" /> <br /><br /> <img src="images/gr_silver.jpg" /> <br /><br /> <img src="images/gr_bronze.jpg" /> <span style="left:29px; top:2px;"><p> For more information on becoming a sponsor of the conference please contact</p> <p>Matthew Moss<br /> Conference director<br /> Tel: +[44] (0)20 7625 0000<br /> E-mail:mm@summittradeevents.com</p></span> </div> <div id="movedatfooter" style="position:relative; right:30px; top:170px;"><?php include('components/Footer.php'); ?></div> <div id="borderbottom" style="position:relative; top:170px; right:30px;"><img src="images/4560-bkground_bottom.jpg" /></div> </div> <div id="sponsorshiplistings" style="position:relative; left:20px; top:20px; z-index:1; <?php echo $listing; ?>" > <img src="images/header_sponsorship.jpg" /> <div id="text" style="top:10px; width:533px;"> Sponsorship provides a prime opportunity for your company to enhance its visibility and corporate presence during the conference. In addition to the intrinsic benefits of each option, all sponsorships include the opportunity to present a paper, full recognition on all promotional materials as an official sponsor and complimentary delegate places. All sponsorships are sold on a first come first served basis. Options can be reserved for a period of 10 working days. <p> For more information on becoming a sponsor of the conference please contact</p> <p>Matthew Moss<br /> Conference director<br /> Tel: +[44] (0)20 7625 0000<br /> E-mail:mm@summittradeevents.com<br /> <br /> We would like to take this opportunity to thank the sponsors of TurkmenTel 2009 for their continued support. <br /> <br /> <img src="images/gr_platinumsponsor.jpg" /> <br /> <br /> <?php $type = "platinum"; include('components/logoviewer.php'); ?> <img src="images/gr_goldsponsor.jpg" /> <br /> <br /> <?php $type = "gold"; include('components/logoviewer.php'); ?> <img src="images/gr_silversponsors.jpg" /> <br /> <br /> <?php $type = "silver"; include('components/logoviewer.php'); ?> <img src="images/gr-bronzesponsors.jpg" /> <br /> <br /> <?php $type = "bronze"; include('components/logoviewer.php'); ?> </p> </div> <div id="movedatfooter" style="position:relative; right:30px; top:15px;"><?php include('components/Footer.php'); ?></div> <div id="borderbottom" style="position:relative; top:4px; right:30px;"><img src="images/4560-bkground_bottom.jpg" /></div> </div></div> </div> </body> </html> I have no idea what the problem is here, ive tried fiddling with some of the positioning properties and nothing seems to have any effect. So any help is greatly appreciated I'm sure some of you have seen the article on alistapart for the suckerfish dropdowns. After recently moving through this, I found a bug with mac ie where the child list is displayed to the side of and not below the major nav link. I'm not sure exactly what this might be, does anyone have any ideas on this? Here's the CSS: Code: #nav ul { margin: 0 0; padding: 0 0; list-style-type: none; } #nav ul li { float: left; position: relative; width: 10em; } #nav ul li ul { display: none; position: absolute; top: 1em; left: 0; } #nav ul li > ul { top: auto; left: auto; clear: left; } #nav ul li:hover ul, #nav ul li.over ul { display: block; } ...and the html... Code: <div id="nav"><ul id="rootul"> <li><a href="#">Link One</a> <ul> <li><a href="#">Sub Link</a></li> <li><a href="#">Sub Link 2</a></li> </ul> </li> <li><a href="#">Link Two </a> <ul> <li><a href="#">Sub Link</a></li> <li><a href="#">Sub Link 2</a></li> </ul> </li> <li><a href="#">Link Three </a> <ul> <li><a href="#">Sub Link</a></li> <li><a href="#">Sub Link 2</a></li> </ul> </li> <li><a href="#">Link Four </a> <ul> <li><a href="#">Sub Link</a></li> <li><a href="#">Sub Link 2</a></li> </ul> </li> <li><a href="#">Link Five </a> <ul> <li><a href="#">Sub Link</a></li> <li><a href="#">Sub Link 2</a></li> </ul> </li> </ul> </div> ..and finally, the javascript.. Code: <script language="javascript" type="text/javascript"> startList = function() { if (document.all&&document.getElementById) { navRoot = document.getElementById("rootul"); for (i=0; i<navRoot.childNodes.length; i++) { node = navRoot.childNodes[i]; if (node.nodeName=="LI") { node.onmouseover=function() { this.className+=" over"; } node.onmouseout=function() { this.className=this.className.replace(" over", ""); } } } } } window.onload=startList; </script> I know that technically this could be a DHTML issue, but I feel certain it's a CSS rule that I'm not doing right. I've tested this and it works in IE 6.0 and FF 1.0. Does anyone have a browser that this does NOT work in? Thanks much! -Brian Over the past few days I've pulled my hair out trying to fix this. I've changed the size of the container and resized the gallery. In IE8, it drops the gallery under the left-hand size text. Every other browser it appears fine but IE it does not. You can see he wowrelief (dot) com/ev css: (URL address blocked: See forum /index_files/style.css I need to finish this for a class and I don't know how to fix it and I'm beyond frustrated. help? I'm working on the site www rabidpursesquirrels com and any time someone resizes their browser to something smaller than full screen (or simply has a small screen display) the middle block drops to the bottom of the screen. I need to find out how to make that stop happening. I don't mind if the site is too wide then and they have to scroll left to right, this would at least fix my first problem. My 2nd problem is the margins between the center block and the sides blocks. I can't figure out where I can adjust those. As you can see currently the left seems to look ok but the right side is all screwed up. I've been through the style sheet for 4 days and can't seem to find what to adjust. I'm new to css and can 'tweek' it ok but writing it is totally out of my league. Thanks in advance, QV Hello, I'm afraid I'm back with more problems I have a 3 column layout. the Left column is floated left, right floated left and the middle column uses left and right margins. I then had cause to set a width on the middle column to give something with Layout for IE. When I add the width to the middle column, it looks fine in firefox but for some reason in IE, my middle div drops underneath the two floated divs, as if it is too wide. I have tried debuging by using background colours on the Divs and the width of the coloured area is the same in both browsers. It is as if there is something leaking out the sides. Even on this most basic example. Am I missing something basic? Code: <div id="wrapper" style="width:996px; background-color:#666666; margin-left:auto; margin-right:auto;"> <div id="lbar" style="float:left; width:170px; padding-left:10px; background-color:#FF0000; "> <p>left</p> </div> <div id="rbar" style="float:right; width:305px; background-color:#0033FF;"> <p>right</p> </div> <div id="middle" style="margin-left:190px; width:491px; margin-right:315px; background-color:#99CCCC;"> <p>middle</p> </div> </div> Thank you for any time taken in reading this JJ For a navigation I am using, I must use an li height to control spacing in IE6. I'm also using bullets to show a user where they are in the site by only having one bullet display at a time. Unfortunately, the height assignment I use on my li causes IE to misplace the bullet next to its secondary nav. Below is code I'm using to troubleshoot: Code: <ul><li><a href="#">dog</a></li> <li><a href="#">cat</a></li> <li class="here"><a href="#">fish</a></li> <ul> <li><a href="#">trout</a></li> <li><a href="#">angel</a></li> <li><a href="#">salmon</a></li> </ul> <li><a href="#">turtle</a></li> <li><a href="#">elephant</a></li> </ul> Code: li {height: 20px; list-style-type: none;} li.here {list-style-type: disc;} If a user is on the page fish, they will see that bullet point to page salmon. Any recommendations? Ok, so I've learned to stay away from tables when you don't need them, and I have an instance where this is the case. I have a container div that has a header, content and a footer. On my home page, I have to divs next to each other with the same height and a div below them towards the right. To simplify my problem, look at this example. Code: <html> <body> <div style="float:right"> Hello there! </div> <hr> </body> </html> If there's a "float:right" on that div, the hr tag below doesn't get pushed down. But if I use relative positioning and don't use the floats, I can't put the two top divs next to each other. The other option is to use absolute positioning, but again content below doesn't get pushed down correctly. It seems that using "clear:both" works, but it seems weird that this has to be done. For example if I have floating divs in a container, I can get them to stretch out the container like so: Code: <html> <body> <div style="border: 1px solid #000; "> <div style="float:right"> Hello there!<br /> Hello there!<br /> Hello there!<br /> Hello there!<br /> Hello there!<br /> Hello there!<br /> Hello there!<br /> </div> <div style="clear: both"></div> </div> <hr> </body> </html> Am I missing something fundamental here? Is there a better solution? Thanks in advance. Centering DIVs inside other DIVs in Firefox? Can it be done in a straight forward way? Setting the inner DIVs float to none seemed to work for IE but not FF. Here's the site in Question: http://www.winchps.vic.edu.au It's a standard fixed width floated DIV columns with a wrapper. One thing it does have is a second DIV inside both columns to display the Gradient background over the top of the repeated background. It works perfect in Firefox & IE7 (with a tweak) but IE6 mkes the sidebar nested div drop below the original sidebar DIV click here for a screenshot for those lucky enough not to have IE6. Here's the CSS code for the basic layout: Code: body { font-family: 'Lucida Grande', Verdana, Arial, Sans-Serif; font-size: 12px; text-align: center; margin: 0px 0px 60px 0px; padding:0px; border: 0; line-height: 2; } #header { width: 802px; } #wrapper { width: 802px; margin:0px; padding: 0px; text-align: left; margin: 0 auto; background: url(images/bodybg.jpg) center repeat-y; } #content { padding: 0px; margin: 0px; } #maingrad { background: url(images/winchcontentgrad.jpg) top left repeat-x; padding: 10px; } #main { width: 589px; float: right; background: url(images/winchcontentbg.jpg) repeat; border-left: solid 1px #000; border-right: solid 1px #000; } #mainstop { width: 589px; float: right; background: url(images/winchcontentbg.jpg) repeat; border-left: solid 1px #000; border-right: solid 1px #000; border-bottom: solid 1px #000; font-size: 10px; } #sidebargrad { background: url(images/winchsidebargrad.jpg) top left repeat-x; padding: 10px 5px 0px 10px; } #sidebar { width: 200px; float: left; background: url(images/winchsidebg.jpg) repeat; line-height: 2; font-size: 14px; border-left: solid 1px #000; border-right: solid 1px #000; } I obviously need to put a conditional comment in there, same for what I did for the minor IE7 tweak, but I'm struggling to suss out what's causing it, I haven't found the specific issue on any of the regular sites (PIE etc). Anyone got any ideas? The Example I've read a bunch about how div's won't stretch to accomidate div's inside of them if they overrun the height/min-height set for the container div. How do I get around this? You can see the skeleton of the site above. It's fine unless you resize the window smaller than the content. Code: <style type="text/css"> <!-- div.wrapper { width: 400px; margin: 0 auto; } div.menu { color: blue; white-space: pre; text-align: right; font-size: 90%; margin: 200px 500px 200px 100px; } div.submenu { color: blue; white-space: pre; margin: 150px 300px 500px -10px; font-size: 70%; line-height: 180%; } body { background: white url("Images/background.jpg") no-repeat top scroll; text-align:justify; margin:200; padding:0; } body,td,th { font-family: Verdana, Geneva, sans-serif; } --> </style></head> <body> <div class="wrapper"> <div class="menu"><span><button style="width:100;height:30" onClick="window.location='XXXXXXX.htm'">MASTER</button></span> <span><button style="width:100;height:30" onClick="window.location='XXXXXXX.htm'">MASTER</button></span> <span><button style="width:200;height:30" onClick="window.location='XXXXXXX.htm'">MASTER</button></span> <span><button style="width:200;height:30" onClick="window.location='XXXXXXX.htm'">MASTER</button></span> <div class="submenu"> <span> <button style="width:200;height:30" onClick="window.location='prva.htm'">title lef</button><br /></span> <span><button style="width:200;height:30" onClick="window.location='XXXXXXX.htm'">title lef</button><br /></span> <span><button style="width:200;height:30" onClick="window.location='prva.htm'">title lef</button><br /></span><br /></span> <span>title lef<br /></span> <span>title lef<br /></span> </div> </body> </html> here is code. please save code with .html and open with browser. Give me sugestions how to move links easily left or right [ write trick if know] thank you in advance loverbugs I have been asked to create a font resize on a website. I can do the basics of it but I'm running into a couple snags Question 1 In my stylesheet, I have: Code: #centerCol { float: left; color: #333; font-size: 10px; padding: 10px 10px 10px 15px; } And in my code I have a function that contains: Code: document.getElementById('centerCol').style.fontSize = '12px'; It works fine to resize the centerCol ID but what if I want to only resize the <p> tags in the centerCol ID? Question 2 Is there a way to resize without the use of Javascript? Everything I've found so far includes it. Hi Whenever I shrink my window in Ie, the Links bar stays in the same place. You can view this at http://www.trowbridge-wiltshire.co.uk/newtrowbridge Code: body { background:#CBDEF5; margin: 1em auto; width: 600px; } #leftcontent { margin: 1em auto; position: absolute; top:100px; left:250px; width:100px; background:#CBDEF5; } #centercontent { margin: 1em auto; width:500px; background:#87B4EB; color:#ffffff; border:2px solid rgb(75,123,211); margin-left: 140px; margin-right:20px; } #advertising { margin: 1em auto; width:500px; background:#87B4EB; color:#ffffff; border:2px solid rgb(75,123,211); margin-left:140px; margin-right:20px; } #banner { background:#CBDEF5; height:40px; padding:5px; } p,h1,pre { margin:0px 10px 0px 10px; } h1 { font-size:14px; padding-top:10px; } background: #c3c8c3; } #button ul { list-style: none; margin: 0; padding:0; border:; } #button li { border-bottom: 1px solid #CBDEF5; margin: 0; } #button li a { display: block; padding: 5px 5px 5px 0.5em; border: 1px solid #1958b7; background-color: #87B4EB; color: #fff; text-align:center; text-decoration: none; width: 100%; } html>body #button li a { width: auto; } #button li a:hover { border: 1px solid #1958b7; background-color: #4B7BD3; color: #fff; } Old story...looks good in IE but, different in FireFox: link to page My goal is to have all the footer infor appear below the content...not wrap up. Any help would be greatly appreciated. Thanks! Hi there! I am tweaking a WordPress template to fit a blog for a roleplaying game. The template is a three-column, fixed-width one. It looks fine on my tiny 17" monitor at work, but at home on my 22", the blog is very small and sits in the center of the page. (The content section is just 904px wide.) Is there a way to tweak the style.css file in order to give the columns percentage widths instead of absolute pixel widths, so that the center "content" area will resize properly according to the reader's resolution/monitor size/window size? I have some experience with CSS and I'm usually pretty good at tweaking pre-existing CSS to fit my needs, but this is something that's a bit beyond me. I can't put a direct URL in my post, but here's a snippet of the CSS file: Code: body, h1, h2, h3, h4, h5, h6, address, blockquote, dd, dl, hr, p, form{ margin: 0; padding: 0; } body{ font-family: Arial, Helvetica, Georgia, Sans-Serif; font-size: 12px; text-align: center; vertical-align: top; background: #fff url(); color: #fff; } h1, h2, h3, h4, h5, h6{ font-family: Arial, Helvetica, Georgia, Sans-Serif; font-size: 16px; } a{ text-decoration: underline; color: #08441e; } a:hover{ text-decoration: none; } a img{ border: 0; } abbr, acronym{ border: 0; } address, dl, p{ padding: 10px 0 0; } blockquote{ margin: 10px 10px 0; background: #fffada url(images/bg_blockquote.gif) no-repeat 5px 7px; color: #736926; } blockquote p{ padding: 10px 10px 10px 20px; } blockquote blockquote{ margin: 10px 20px; background: #fff; color: #333; } blockquote blockquote p{ padding: 10px; } code{ background: #f9f9f9; } dt{ font-weight: bold; } dd{ padding: 0 0 5px 15px; } hr{ clear: both; margin: 15px 0 5px; width: 100%; border: 0; height: 1px; text-align: left; background: url(images/bg_comment_bottom.gif) no-repeat; } small{ font-size: 10px; } input, textarea{ font-family: Arial, Helvetica, Georgia, sans-serif; font-size: 12px; padding: 2px; } input#author, input#email, input#url, textarea#comment{ border: 1px solid #cbb945; background-color: #fffadb; padding: 3px; } input#author, input#email, input#url{ margin: 0 5px 0 0; } #container, #header, #menu, #menu ul li, #menu ul li a, #pagetitle, h1, #syndication, .pagewrapper, .page, .wrapper, .narrowcolumnwrapper, .narrowcolumn, .content, .post, .entry, .browse, sidebar{ text-align: left; vertical-align: top; } #container{ margin: 0 auto; width: 904px; padding: 10px 0 0; } #header{ margin: 0 0 10px; float: left; width: 904px; height: 250px; background: url(images/bg_header.gif) no-repeat left bottom; color: #333; } #menu ul{ margin: 0; padding: 0 0 0 175px; list-style: none; } #menu ul li{ float: left; margin: 0 5px 0 0; font-size: 14px; font-weight: bold; background: url(images/bg_tab_right.gif) no-repeat right top; color: #ffffff; } #menu ul li a{ display: block; padding: 14px 20px 10px; text-decoration: none; background: url(images/bg_tab_left.gif) no-repeat left top; color: #ffffff; } #menu ul li a:hover{ text-decoration: underline; } #pagetitle{ clear: both; width: 904px; height: 250px; } } #pagetitle h1 a{ text-decoration: none; color: #fff; } .pagewrapper{ margin: 0 0 10px; float: left; width: 904px; background: #fff url(images/bg_page_bottom.gif) no-repeat left bottom; color: #333; } .page{ float: left; padding: 0 5px 5px; background: url(images/bg_page_top.gif) no-repeat; } .wrapper{ /* This wrapper class appears only on Page and Single Post pages. */ float: left; width: 500px; } .narrowcolumnwrapper{ margin: 5px 0 0; float: left; width: 500px; background: #fff url(images/bg_narrowcol.gif) repeat-y; } .narrowcolumn{ float: left; width: 500px; background: url(images/bg_narrowcol_bottom.gif) no-repeat left bottom; } .content{ float: left; width: 500px; background: url(images/bg_narrowcol_top.gif) no-repeat left top; } Thank you! |