CSS - Css Skills Quiz Challenge #1
Hi,
This will be similar to Sitepoint's CSS Quizzes. If you know how to do the particular image I assign then please PM me the answer with the code to see if you figured it out I was asked to fix this problem the other day and it took me about half an hour to work out how to do it. So lets see how bright you lot are and who can give me the solution first. Your job is to produce this effect http://www.devwebsites.com/temp/quiz1.PNG Rules Can not touch the HTML in the <body> section No javascript or scripting of any kind No expressions or conditional comments Use Valid CSS Use Valid xhtml No hacks, no child selectors, no universal selecors, no means of offering separate code toeach browsers. Must work in IE7 If you manage to get it in IE6 then bonus points If no one gets this then I will just post the solutions at the end of the week. Please remember to PM me the answers and not post the answer code in the thread. If you have any quiz ideas, please PM me also. Here is the base code you must use. Edit the CSS all you like, but remember the rules 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" xml:lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Quiz 1</title> <style type="text/css"> </style> </head> <body> <div id="green"> <div id="yellow"></div> <div id="orange"></div> <div id="red"></div> <div id="blue"></div> <div id="indigo"></div> <div id="violet"></div> </div> </body> </html> Similar TutorialsI have a header to this website that I am working on and my part is due real sone. I am stuck. I am using css to display the header and it lloks like a million bucks in IE 6 but not in IE7 and especially not in FireFox. Can anyone help me fix it. The code is he PLEASE HELP !! How am I supposed to make this with html/css? For the header, I will make it different color; blue, green, pink, etc. But I think the hard part is the rounded border with thin black. I've attached an sample, please help me if you can. Ok, here's a bit of short background. I haven't done web design or graphic design of any kind in years, and I decided a good way to get back into it would be to give my band's (Cassius) myspace page a facelift. I set up a phony copy of our own, in order not to frustrate any users on our page while I inevitably blundered through the new design. Now, if you aren't familiar with coding on Myspace, it only allows you to edit several sections of your page, and not at all the overall code of the document itself. This means any serious changes you want to make are done very vicariously through CSS, being placed somewhere in the middle of the actual source of the page itself. Irritating, but workable. Everything was going very well. I got frustrated several times, but always found a way to do what I wanted. That is, until I opened the page in IE (v6 and v7 later). (URL address blocked: See forum rules) That is the address. So far, everything appears as I want in Firefox. However, when using IE, the flash player doesn't position correctly, and there are some other minor issues as well. The flash player is the largest problem. So my question is this....how can I persuade IE to position everything properly, while fitting within the ridiculous (im)practical constraints of the actual coding, placed by Myspace? Thanks in advance!! I am sitting here with a css challenge and I cannot even start to imagine how to do it. In fact, I think it is impossible to do, but just thought I'd ask you guys in case I am wrong: I want to create a dropdown menu (something like coolmenus) that can be created dynamically out of a database. The first thing I want to happen is that all primary navigation items are lined up horizontally next to eachother. That one was easy: I put each item into a DIV and float them left. Now the problem: whenever a user moves the mouse over a primary navigation item, a dropdown menu will appear underneath it. However (!), this dropdown menu may be wider than the DIV above it! Here an example: ------------- ------------- | Item 1 | | Item 2 | ------------- ------------- ----------------------- | Dropdown 1 | ----------------------- ----------------------- | Dropdown 2 | ----------------------- The problem I see is that I want the dropdown menu to always be left aligned with the primary navigation item. As I don't know the absolute position of either of them (being created dynamically out of a database), the only way to get the left alignment is to write the DIVs (primary item and its dropdown) directly after each other in the code. However, if I do that I cannot get the primary navigation items to appear one next to each other. Well, I could, but they wouldn't overlap with the dropdowns as I want them to. To give you an idea of what I am trying to achieve, have a look at the dropdown he http://www.rmitenglishworldwide.com...ts/products.asp I have a link such as this <div id="columns"> <a href="whatever.htm">Whatever</a> </div> For reasons I won't go into here, I cannot change the div. And that div contains: #columns a:link { color: #0000C0; text-decoration: none; font-weight: bold; } #columns a:visited { color: #000080; text-decoration: none; font-weight: bold; } #columns a:hover { color: #FF0000; text-decoration: underline; font-weight: bold; } The above is fixed, non-changeable. What I want to do is change the color of the link, even thought I cannot change the div or the CSS code above. I tried: <a href="whatever.htm" class="colorchange">Whatever</a> where colorchange is: .colorchange { color: red } Nope. Doesn't work. I'd like to put some kind of class in the middle of the <a tag that will have some effect on the appearance of the link, but the above doesn't work. Any ideas what I can do, given that I can only change the <a link and not the <div> or the CSS? Thanks ...Vidya www.webwisesage.com Is this possible? Currently onclicking a dynamically created option in my select menu an URL is sent to change the .src of an IFRAME. The external content in the IFRAME does not match my site (it's a portal) style (bg, alignment, font etc.) I want to make it fit in but ofcourse cannot set attributes to external pages. Can the URL be loaded in a 0 size frame or hidden IFRAME and it's contents, the source code, be taken on load and put into a new div tag on my own page with the neccessary style additions? Notably the URL source has it's own style.css, is an alternative to change the href of that style.css onload? =D Mark. Hi all, I've been trying hard but I can't figure out this one: I have two pieces of HTML content inside a container DIV: the first block is short, the second one is LONG. They must stay up as two columns (the long block can't wrap under the short one), but NO assumptions on contents of block #1 or #2 can be made: no width values can be chosen. The intended layout is something like: ┌─────────────────────────┐ │ External container │ │ ┌───────┐┌─────────────┐ │ │ │Block 1 ││ Block 2 │ │ │ │ ││ Both widths │ │ │ └───────┘│ are UNKNOWN │ │ │ └─────────────┘ │ └─────────────────────────┘ i.e. I want to reuse this code in a variety of situations (where I can't foresee how much content will be on either one but they still must fit two columns) so I can't use a silly solution like 'set margin of block X to be wider than block Y and make it float'. Remember: we have NO IDEA of what block 1 or 2 width may be set to. Any ideas? TIA, Hataru Mendohohoh Join Date: May 2008 Posts: 2 Firefox bug combining absolute and fixed positioning Hey helpful people. I am designing a site which has a floating toolbar (position: fixed) with popup menus. The popup menus are using nested lists and position: absolute to display. JavaScript is dealing with the transition. The problem is that in firefox alone the fixed toolbar jumps when the popup menus show and hide. Removing either position: fixed or the offset (bottom: 27px) removes this problem. However these need to be present in the design. Anyone know a workaround? (webpage and css below) Code: <div class="toolbar_O"> <div class="toolbar_I"> <!-- top page info --> <div class="pageInformation cf"> <!-- Page Status Info Start --> <div class="pageStatus"> <h4 class="statusLabel">Status: </h4> <span class="status">Live</span> </div> <!-- Page Status Info End --> <div class="RHS cf"> <div class="toolbarMenu"> <ul> <li class="publicationDates"><a href="#" title="Publication dates">Publication dates<span class="moreArrow"><span class="wai">^</span></span> <!--[if gte IE 7]><!--></a><!--<![endif]--> <ul class="popup"> <li> <form> <p> <label for="email" class="expiryDate">Set expiry date</label> </p> <input type="text" class="inputTextbox" name="expiryDate" id="expiryDate"/> <p> <label for="email" class="liveDate">Set live date</label> </p> <input type="text" class="inputTextbox" name="liveDate" id="liveDate"/> </form> </li> </ul> </li> <li class="dateAction"><a href="#" title="Last published">Last published 29/01/08<span class="moreArrow"><span class="wai">^</span></span> <!--[if gte IE 7]><!--></a><!--<![endif]--> <ul class="popup"> <li> <p class="cf"><span class="label">Author:</span><span class="value">Anne Light</span></p> <p class="cf"><span class="label">Approver:</span><span class="value">John Smith</span></p> <p class="cf"><span class="label">Review date:</span><span class="value">21/06/07</span></p> </li> </ul> </li> <li class="versions"><a href="#" title="Other versions">Other versions (#)<span class="moreArrow"><span class="wai">^</span></span> <!--[if gte IE 7]><!--></a><!--<![endif]--> <ul class="popup"> <li> <p>Ann Light's version sent for approval on 24/12/07 at 10.03am</p> </li> </ul> </li> </ul> </div> </div> </div> <!-- bottom user functions --> <div class="userFunctions cf"> <!--Left Hand Side Buttons Start --> <div class="btnLHS"> <a id="#" class="btnHelp" title="Help" href="#">Help</a> <div class="toolbarMenu pageActions"> <ul> <li class="otherPageActions"><a href="#" title="Other page actions">Other page actions<span class="moreArrow"><span class="wai">^</span></span> <!--[if gte IE 7]><!--></a><!--<![endif]--> <ul class="popup"> <li> <ol> <li><a href="pa001a_delete_page.html" class="lbOn modal:{width:450}" title="Delete page">Delete this page</a></li> <li><a href="pa002_set_date.html" class="lbOn" title="Set date">Set publication/expiry date</a></li> <li><a href="pa003_page_permissions.html" class="lbOn modal:{width:450}" title="See page permissions">See page permissions</a></li> <li><a href="pa004_add_subpage.html" class="lbOn" title="Create sub page">Create sub page</a></li> <li><a href="pa005_page_history.html" class="lbOn modal:{width:450}" title="See page history">See page history</a></li> <li><a href="#">Preview</a></li> <li><a href="link_1d.html" class="lbOn modal:{width:450}" title="Save a copy">Save a copy</a></li> </ol> </li> </ul> </li> </ul> </div> </div> <!-- Left Hand Side Buttons End --> <!-- Right Hand Side Buttons Start --> <div class="btnRHS"><a href="st016_page_notes.html" class="lbOn pageNotes" title="page notes">See page notes</a> <a id="#" class="btnReject" title="Do Not Approve" href="#"><span class="buttonText">Don't Approve</span></a> <a id="#" class="btnApprove" title="Approve" href="#"><span class="buttonText">Approve</span></a> </div> <!-- Right Hand Side Buttons End --> </div> </div> </div> Code: div.toolbar_O { background: #eaf1f9 url(../images/interface/toolbar_bg.gif) 0 0 repeat-x; border: 1px solid #3a8ea8; padding: 9px 0px; width: 729px; color: #0a3b3f; font-size: 0.9em; position: fixed; bottom: 20px; left: 100px; height: 82px; } body.editMode div.toolbar_O { position: relative; left:0; bottom: 0; float:right; } .toolbar_O .toolbar_I { border: 1px solid #073f58; background: url(../images/interface/toolbarinner_bg.gif) #54b4cc; margin: 0px 9px; } .toolbarMenu ul li a, .toolbarMenu ul li a:visited { font-weight: bold; color: #77aeb5; border: 1px solid #287e95; text-decoration: none; padding: 4px 5px 6px 5px; background: #e6f4f5; color: #0a3b3f !important; display: -moz-inline-box; display: inline-block; height: 13px; } .toolbarMenu ul { padding:0; margin:0; list-style-type: none; margin: 0; } .toolbarMenu ul li { float:left; position:relative; margin: 0 0 0 10px; } .toolbarMenu ul li ul li { margin: 0; font-size: 0.9em; } .toolbarMenu ul li ul { visibility: hidden; position:absolute; bottom: 27px; left:0; padding: 5px; background: #ebf6f8; border: 1px solid #2e869c; margin: 0; z-index: 1000; font-size: 1em; text-align: left; } .toolbarMenu ul .moreArrow { display: -moz-inline-box; display: inline-block; padding: 6px 8px; width: 1px; margin-left: 10px; border-left: 1px solid #89abb7; background: url(../images/interface/morearrow.gif) 3px 0 no-repeat } .toolbarMenu ul li.open ul { visibility: visible; } .toolbarMenu ul li.versions.open ul { width: 250px; } div.toolbar_O .toolbarMenu ul li.open a { color: #4594A5 !important; } div.toolbar_O .toolbarMenu ul li.open .moreArrow{ background: url(../images/interface/closearrow.gif) 3px 0 no-repeat; } /* top part of toolbar */ .toolbar_O .pageInformation { padding: 6px; height: 25px; } .toolbar_O .pageInformation .pageStatus { color: #FFF; font-size: 1.3em; width: 170px; float: left; } .toolbar_O .pageInformation .RHS { float: right; } h4.statusLabel { height: 100%; display: inline; text-transform: uppercase; } div.toolbar_O div.pageInformation .label, div.toolbar _O div.userFunctions .label { width: 75px; float: left; text-align: left; } div.toolbar_O div.pageInformation .value, div.toolbar _O div.userFunctions .value { font-weight: bold; text-align: left; float: right; vertical-align: top; width: 75px; } div.toolbar_O div.pageInformation .inputTextbox { width: 80%; } /* bootom part of toolbar */ .toolbar_O .userFunctions { padding: 8px 0; height: 25px; } div.toolbar_O div.userFunctions div.btnRHS { float: right; margin: 0px 10px 0px 0px; } div.toolbar_O div.userFunctions .btnLHS { float: left; margin: 0px 0px 0px 10px; } div.toolbar_O div.userFunctions div.btnLHS a.btnHelp, div.toolbar_O div.userFunctions div.btnLHS a.btnHelp:hover { padding: 5px 5px 5px 25px; margin: 1px 5px 0 0; background: #e6f4f5 url(../images/interface/icon_help.gif) 3px 3px no-repeat !important; float: left; border: 1px solid #287e95; text-decoration: none; font-weight: bold; color: #0a3b3f; height: 12px } .toolbarMenu.pageActions { float: left; } .toolbarMenu ol { margin: 0; padding: 0; width: 320px; height: 60px; list-style: none; } .toolbarMenu ol li, .toolbarMenu ol li a { margin: 0; padding: 0; float: left; width: 150px; min-height: 8px; display: inline-block; border: none !important; color: #0a3b3f !important; font-size: 1.2em; background: none; } div.toolbar_O div.toolbar_I a.pageNotes { font-weight: bold; color: #0a3b3f; } div.toolbar_O div.toolbar_I a.pageNotes:hover { color: #FFF; } /* approve/reject btns */ div.toolbar_O div.userFunctions div.btnRHS a.btnApprove, div.toolbar_O div.userFunctions div.btnRHS a.btnReject { border: 1px solid #287e95; border-bottom: 2px solid #06465f; border-right: 2px solid #06465f; text-decoration: none; height: 12px; padding: 5px 15px 5px 0; background: #fffeff url(../images/interface/icon_approve.gif) 95% 3px no-repeat; display: -moz-inline-box; display: inline-block; color: #0a3b3f; } div.toolbar_O div.userFunctions div.btnRHS a.btnApprove:hover, div.toolbar_O div.userFunctions div.btnRHS a.btnReject:hover { background-color: #135d82; border: 1px solid #FFF; border-bottom: 2px solid #06465f; border-right: 2px solid #06465f; color: #FFF; } div.toolbar_O div.userFunctions div.btnRHS a.btnReject { background: #fffeff url(../images/interface/icon_reject.gif) 95% 3px no-repeat; } li.otherPageActions ul, li.otherPageActions ul li{ margin: 0; padding: 0; list-style: none; } |