CSS - Help Combine Style
Could someone please help me work this one out, been at it from last night and still can't figure it out?
I have 2 styles, button and tips. I have 5 buttons total and the first 4 are fine as is opening a linked page. I need help to make the last one which uses the tips style to open a mouse-over message to also be displayed with the same button style. Thanks a bunch, the forum won't let me post the text so here is a link to it. lastborns.tripod.com Similar TutorialsI am just wondering if there is a way to simply extend a style rule from one previously defined. For instance, if I have this rule: Code: .textarea-box { color: #990000; background-color: #fff; width: 375px; height: 200px; border: #000 solid 1px; } ...if I want another text area rule to be the same except for one difference, the height should be 80px, do I have to write the rule out again with a new name, incorporating the new height, or is there some nifty way to just change the height in the new rule? Thanks for help with this. j9 I have a menu bar made up of <a href> elements that have a hover style of:
PHP Code: #mainMenu a:hover { color:#000000; background-color: #66c74c; padding: 1px 4px 1px 4px; margin: 1px 1px 1px 1px; } This will provide a green colored rollover visual as the user moves their mouse over the menu bar. I just added some JS today that will highlight the clicked (selected) menu so there is visual feedback of the section the user is in. For some reason, after setting the background color of the <a href> and color attributes, the HOVER: no longer functions. Here is the code to do the hilite where I pass the ID of the <a href> menu selection in the variable "menu": PHP Code: //--- Simplify setup by creating an array of the menus and hilight ID's --- var menus = ["menu1","menu2","menu3","menu4","menu5", "menu6","menu7","menu8","menu9","menu10"]; function J_hiliteMenu(menu) { //--- first make sure all the menu are hidden and unhilited --- for(i=0; i < menus.length; i++) { if (menus[i] == menu) theIndex = i; // Hold on to the chosen index position var obj = document.getElementById(menus[i]); if (obj == null) continue; // if menu is not available skip it obj.style.color = "#ffffff"; obj.style.backgroundColor = "#234fd7"; } //--- hilite the menu we're interested in --- var obj = document.getElementById(menu); obj.style.color = "#000000"; obj.style.backgroundColor = "#f8f400"; } Prior to hiliting the menu I un-hilite all the menus (since we may be switching from another). I think this is where the problem is. Maybe I need to redefine the rollover "hover" attribute for all elements during the un-hilite loop? Does anyone know how to set a HOVER: attribute using JavaScript? Thanks! How do I put two class name into one td cell? I don't want to use like this .bk {background-color: #ff0000; padding: 10px; } Example: Code: <style type="text/css"> .bk { background-color: #ff0000; } .pd { padding: 10px; } </style> <table><tr><td class="bk" class="pd"> hello<br> blah blah<br> blah blah blah </td></tr></table> Hi, I have a liquid 2 col layout, the left column needs to have a fixed with of 300px whilst the right col just needs to fill the rest of the space. Has anyone got any suggestions or examples on how this can be done? Thanks, Scott I'm creating a bunch of stylesheets for our intranet, and rather than have our webmasters use a <link> tag for each individually, i thought I would use @import statements within one main stylesheet. Like this: Code: @import url("1.6/core.css"); @import url("1.6/mobile.css"); As you see above, there's a mobile stylesheet as well, which has something like this inside: Code: @media screen and (max-device-width: 480px){ ..stylesheet code... } This all works fine, though I got to thinking it would be nice to somehow specify in the import statement this is a mobile stylesheet, so desktop browsers wouldn't bother downloading it. Using a <link> tag I could do: Code: <link rel="stylesheet" type= "text/css" media="only screen and (max-device-width: 480px)" href="iphone.css" /> Is there a way to do something similar with the @import line? Hi! Could some experienced CSS developer please confirm this: All paddings, and right and left margins, always combine (what I mean is if you have a left object with a 5px right margin and a right object with a 5px left margin, the distance between the two will be 10px). However, bottom & top margins never combine. Is all this true? How would you go about creating a navbar like the one Red cross uses on the left side for generic website mapping? Red Cross Example Is this pure css with dual images? Or is this done with some effect with other forms of CSS (or even DHTML?) on my site I have a list with the UL Class of threads. I am not good with CSS at all I have this Code: #threads { padding:0; margin:0; } #threads li { list-style:none; border-bottom:1px dotted #ccc; display:block; padding:2px 0px 2px 13px; background:url(images/sub.png) no-repeat 0 0px; } not doing what I want, my site is mypricesavings(dot)com you can see the list on the homepage under Recent Activity, I'd like to make it so that the avatars line up on top of each other and a line between each one like the featured section located on this site, however, without the scrolling. http://demo.colorlabsproject.com/?theme=arthemia-premium thank you for attempting I did a web page for a company and it looks fine in ie7 where I tested it. The problem is when viewed in IE6 its like it ignores the sizes I put in. The box appears too big in IE6 and is the propr size in IE7. Is there any way to fix it so it would look the same in IE6 as IE7? Hello, In the css below, why I can't set it on the same time? Code: background: #FFF url(../images/main_bottom.gif) no-repeat bottom ; background: #FFF url(../images/main_top.gif) no-repeat top ; I was reading a tutorial were they always style both <tr> & <td> with the same thing... Is this needed? Or do you just need to style <tr>? Code: table.navigation tbody tr.odd { background: #252525; color: #fff; } table.navigation tbody tr.odd td { background: #252525; color: #fff; } hello there. I place a class="titlebg2" on tables on my site in order to give them the nice background image, font, etc ... yet, on a specific table, I would like to overcome the font-size. how could this be done ?? I tried placing the following before the table in question, Code: <div style="font-family: Times; font-size: 12px"> but this did not work. any help ?? quick question: not sure if this is possible. I want to know if it is possible to create one style with set properties. Then a second style, set it equal to the first one, instead of copying the properties to the second. theoretically: .style1 { prop:1; prop:2; prop:3; } .style2 = .style1 if it can't be done, then let me know, I know how to copy and paste. I was just curious it if was Hi people, What is the equivalent of this div style attribute in css? <div style="overflow: hidden; position: absolute; left: 0px; top: 0px; width: 500px; height: 300px"> Its the overflow what I'm looking for. -just edited this that I have the solution sorry beginners corner Hai guyz!! I've been workin' on this website template since December and I was just wonderin' if you guyz (the pros) would share your opinion on the design -- pretty peasss! http://i898.photobucket.com/albums/ac183/micha8l/web_page.png k thx, Mike Can anybody solve the mystery of what's going on on this page?: http://www.j-archive.com/showscores.php?game_id=3346 The "Jeopardy! Round" score table and the "Double Jeopardy! Round" score table should look exactly the same, but on my browsers (Chrome 4 and IE6) the "Double Jeopardy! Round" table has a wider td for the first row. It's as if it's "inherited" the width of the tds that follow it (or perhaps came before it?)... I've checked over the markup and the CSS several times and I can't find any errors that would cause this. What's going on? Thanks-- Again I have arrived with yet another inquiry regarding tableless layouts. I have been tasked with the creation of a fairly complex calendar application. Creating this using tables would be no problem for me, but I am wondering if this is what I should be doing. I remember hearing that you should only display "tabular data" using tables, which would imply that I should be using divs and the like to create this app, not tables. Does anyone have any resources that specifically tackle the task of creating a calendar using CSS techniques? I feel that I could do it, but I just need a basic approach to get me started. The biggest issue I am having is regarding the days dropping down to a new "row" after seven boxes have been displayed. I can provide no code, obviously, since I haven't started yet. I'm just merely looking for some insight. Thanks in advance! Hi, I'm new to CSS and am trying to design my blog template. For the styles, I have this so far: Code: <style type="text/css"> #navbar-iframe{display: none;height: 0;} body{background: #FFFFFF; font: 13px arial;color: #999;line-height: 150%;} .left { width: 460px; text-align:justify; } .right { width: 180px;font: bold 11px arial;color: #c8c8c8; } .navigations{ background: #6a6a6a; text-decoration: blur; padding-top: 1px; border-bottom: 3px solid #666 ;float: right; width: 190px; font: 28px arial; color: #aaa; line-height: 200%;text-transform: lowercase; letter-spacing: -2px; } .navigations :hover{ font: 28px arial; text-decoration: none; padding-top: 1 px; border-bottom: 3px solid #666; float: right; width: 190px; color: #F2EAEA; background: #777; line-height: 200%;text-transform: lowercase; letter-spacing: -2px; cursor: crosshair } .cloud { font: 26px georgia;letter-spacing: 1px;color: #BDA28F } .icon {border: 20px solid #eee; width:100px; height:100px;} .h1 { font: 20px times new roman;color: #FD0479; letter-spacing: 0px; line-height:18px;text-transform:uppercase} .h2 { font: 12px arial; color: #6a6a6a; letter-spacing: 1px; text-transform: lowercase;padding:4px;background: url((URL address blocked: See forum rules)); } .h3 { font: 12px arial; color: #6a6a6a; letter-spacing: 1px; font-weight:bold;padding:4px;} a:link,a:active,a:visited {font: 12px arial; color: #aaa; border-bottom: 1px solid #6a6a6a; text-decoration: none;text-transform: none;letter-spacing: 0px; } a:hover { color: #8BC4C4; border-bottom: 1px solid #e8e8e8;background: #f2f2f2; text-decoration: none; cursor: crosshair} b { color: #BE0304;font-weight:bold; } i { color: #FA727C; } s { color: #ddd; } em {font-family: georgia} blockquote{ color: #999; background: #f5f5f5;padding: 8px; } </style> But I can't seem to get the hover navigations to change background colour and text colour. What am I doing wrong? Thanks! I have links at the bottom of my site, similar to the links at the bottom-right corner of this forum. The links are white, except when hovered over they turn grey. Now my problem is that each time you look at a page, at least one of these links will not show the grey hover effect, they'll just stay white. I've tried this in Firefox and IE 6 with the same results. It can't be my coding because the links do this at random. Anyone ever come across this? *Here's the HTML and CSS code <td height="27" valign="top" background="images/bottom.gif" style="background-repeat:repeat-x"><div align="center" style="padding-top:11px" class="links"> <a href="/">Home</a> | <a href="company.php">Company</a> | <a href="order.php">Order</a> | <a href="support.php">Support</a> | <a href="clients.php">Clients</a> | <a href="legal.php">Legal</a> | <a href="privacy.php">Privacy</a> | <a href="sitemap.php">Sitemap</a></div></td> .links a:link { color:#FFFFFF; text-decoration:none; } .links a:hover { color:#CCCCCC; text-decoration:none; } .links a:visited { color:#FFFFFF; text-decoration:none; } .links a:active { color:#FFFFFF; text-decoration:none; } |