CSS - Background Color For Input Fields
I'm trying to declare different charactoristics for different inputs (i.e. submit, checkbox, radio). I have this code, however, I can't seem to get the checkbox background color to go away. I want to declare the background color of the submit and button fields white, but have the checkbox be whatever color the page is.
Code: input,textarea, select { font-family : Verdana; font-size : 12px; background-color : #ffffff; } input.checkbox { border: solid 0px #666666; } Similar TutorialsHi, Please see http://lbclibrary.org/addtoinquiry.php (scroll down a bit to see the form) What I want to do is, when the user selects "I am a member of ..." or "I want to become a member of..." the form fields in the OTHER cell should become readonly (i.e. should not allow input). Is it possible to make ALL the form elements in one <td> cell as readonly? Further, is it possible to change their background colors to say light grey? Then, when you select another radio option, that cell becomes writable and the other cell becomes readonly. Thanks a lot! Is there a simple way of applying a CSS style to only the form fields that are empty? I searched online and found this but doesn't seem to work. Code: input[value=""] { background-color: #FFFF66; } any other ideas? Hello, Can someone please tell me what I am doing wrong here. I am trying to alter the background of an input using css. It seems to work in IE but not in fierfox. Below is the sample code. Thanks. Code: <head> <style type="text/css"> .container{ width: 610px; height: 300px; border:solid 3px #59813a; } #format1 input{ background-color: purple; width:75px; } </style> </head> <body> <div class="container"> <form id="form" name="form" method="post" action="index.html"> <table> <tr> <td >Last Name</td> <td ><input type="text" name="name" value="enter name" class="size1" /></td> <td>name</td> <td><div id="format1"><input type="text" name="name" id="name" /></div></td> </tr> </table> </form> </div> <!-- container --> Usually I find anything I need to know if I have the source code of a web site but this time I've lost. Some web sites changes the background color of the browsers address (URL) input field (works only with Gecko type browers I think). Just one example: https://www.gmx.net (a commercial email service provider in Germany). How can this be done? Ciao, Meph When using Safari, whenever you click inside an input field, a highlight goes around the field (focus ring). Is there anyway to use CSS to remove the focus ring altogether? Is it possible to differentiate between various types of input field, e.g. assign a width to text inputs but leave buttons to find their own width based on content. I know I can do this by assigning certain elements a class but I'd prefer not to have to do this. Thanks I have a php application that requires the applicant to input information on their spouse. If they claim to be single the fields for spouse dissapear using javascript to make a <div> surrounding the fields "hide". This leaves a blank gap on the applicaton where the fields use to display. How would I go about moving the questions below it on top of the hidden spouse fields? here is the current javascript I am using to accomomplish this. It uses a php loop to display the questions for X amount of owners. Code: <? echo "<script language=javascript type='text/javascript'>"; for($i=1; $i <= $_SESSION['principal']['numOwners']; $i++) { echo " function hidediv".$i."() { if (document.getElementById) { // DOM3 = IE5, NS6 document.getElementById('hideShow".$i."').style.visibility = 'hidden'; } else { if (document.layers) { // Netscape 4 document.hideShow".$i.".visibility = 'hidden'; } else { // IE 4 document.all.hideShow".$i.".style.visibility = 'hidden'; } } } function showdiv".$i."() { if (document.getElementById) { // DOM3 = IE5, NS6 document.getElementById('hideShow".$i."').style.visibility = 'visible'; } else { if (document.layers) { // Netscape 4 document.hideShow".$i.".visibility = 'visible'; } else { // IE 4 document.all.hideShow".$i.".style.visibility = 'visible'; } } } "; } echo "</script>"; I am having a heck of a time dealing with IE7 and how it handles z-index tags on SELECT elements and DIV's. This problem only exists in IE7 and does not manifest in IE6, Firefox (Mac/Win) or Safari (Mac/Win). I've posted a concise example of my problem on one of my servers to better illustrate my problem: Sample Problem Page. Check it out using IE6 and then using IE7. Or if you don't have IE6, I've posted a screenshot of what it looks like. I would appreciate any help solving this problem for IE7. Feel free to copy the source code and play with it and even keep the combo-box drop down code for your own use (if you help me get it working of course, ha ha). i wanted usersto choose their own style sheet by giving them different links like red, green, blue which will take them to different layouts or background color page. the problem was that worked only for that particular page but if they click on any link or menu from that page it will take them back to the default color. is there any way that i can set so that their choice will stay throught their surfing ? any thoughts ? hanks Hi there people, I have a question about CSS but before I start off asking this question I'll introduce myself. I'm a new user of this great forum, my name is Dwight and I'm a student on the "Graphical Lyceum Amsterdam" where I follow the education for "Multimedia Designer". Ok so now you know me a little, I'll start off asking my question. Question: I have to change the layout for a html page that askes for information from different asp pages, but that's not my problem . The problem is that I have to make some td's a different color -the background that is- but the problem is that I can't change the html page itself (it is automaticly generated and I don't have permission to change it). So my question is can someone tell me how I can change the color of some (not all!) td's with CSS without making classes? Tnx, Dwight Hi, I am trying to apply a background color to an item other than the body but I cannot make it display in IE 6 or 5.5. I have tried applying it to both <div>'s and <p>'s. Does IE not support the background-color property outside of the page background? Hey Guys! I'm going absolutely bonkers trying to find out how to change the color of the background of a certain element on my site. I installed Vanilla forums on my site and am trying to customize the css script. If you look at the page, you will see an annoying white in the body. I am trying to make the background of that #F6F6F2. Could you guys possibly put me in the right direction? Thanks! Here is a link to my page: shipswatchdotcom/forum/vanilla/aaa.html Here is the css script: Code: #Body { margin: 0; width: 99.9%; position: relative; background: #F6F6F2; } #Head { background: #B8D4B8; padding:0; margin: 20px 20px 0; text-align: left; position: relative; } div.Popup h1, div.Popup h2, div.Connect h1, div.Connect h2 { background: #F6F6F2; border-bottom: 1px solid #3b5998; } .Banner { padding: 10px; text-align: left; position: relative; background: #F6F6F2; } .Banner ul { background: #B8D4B8; padding: 0; margin: 0; } .Banner ul li { display: inline; padding: 0; margin: 0; } .Banner ul li a { font-weight: bold; padding: 3px 6px; font-size: 11px; color: #336633; display: inline-block; } .Banner ul li a:hover { background: #E5F0E5; } .Banner ul li a.SignOut { font-weight: normal; position: absolute; top: 10px; right: 10px; } .Banner ul li a span { border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px; padding: 1px 2px 0 1px; background: #F6F6F2; border-right: 1px solid #F6F6F2; border-bottom: 1px solid #F6F6F2; color: #F6F6F2; font-size: 9px; position: relative; top: -3px; } #Content { float: none; width: auto; margin: 0 280px 0 10px; background: #F6F6F2; } #Panel { float: right; margin-right: 10px; background: #F6F6F2; } #Panel div.SearchBox input.InputBox { width: 200px; margin-right: 4px; background: #F6F6F2; } div.SearchBox { margin-bottom: 6px; } body.Profile div.SearchBox { display: none; } body.Profile #Content { float:none; width: auto; margin: 0 10px 0 280px; background: #F6F6F2; } body.Profile #Panel { margin: 0 0 0 10px; background: #F6F6F2; } form.Activity textarea { width:99%; background: #F6F6F2; } #Foot div { width: auto; background: #F6F6F2; } body.Post #Content { width: auto; margin:0 20px; background: #F6F6F2; } #ConversationForm textarea.MultiComplete, #ConversationForm .TextBox, #MessageForm textarea, div.Comment div.CommentForm, div.Comment div.CommentForm textarea, div.CommentForm textarea, #DiscussionForm input.InputBox, #DiscussionForm textarea { width:99%; background: #F6F6F2; } #ConversationForm form { border: none; } div.Preview div.Message, ul.MessageList div.Message { clear: none; } #DiscussionForm form { background: #F6F6F2; border: 1px solid #ccc; } div.MessageForm, div.Tabs { background: #F6F6F2; border-bottom:1px solid #ccc; } /* Tabs */ div.Tabs { background: #F6F6F2; padding: 0; border-bottom: 1px solid #aaa; } div.Tabs ul { padding: 0 8px; white-space: nowrap; } div.MessageForm { padding: 8px 8px 5px; } div.MessageForm div.Tabs { padding: 0 8px; } div.Tabs li a, div.Tabs li a:link, div.Tabs li a:hover, div.Tabs li a:active, div.Tabs li a:visited { font-size: 11px; margin: 0; border: none; border-radius: 0; -moz-border-radius: 0; -webkit-border-radius: 0; background: #F6F6F2; color: #336633; text-decoration: none; padding: 8px 10px; line-height: 11px; } div.Tabs li a:hover { text-decoration: underline; } a.Active, div.Tabs li.Active a { background: #F6F6F2; color: #336633; margin: 0; border: 1px solid #aaa; border-bottom: none; border-radius: 3px 3px 0 0; -moz-border-radius: 3px 3px 0 0; -webkit-border-radius: 3px 3px 0 0; display: inline-block; font-size: 12px; line-height: 12px; font-weight: bold; text-decoration: none; padding: 6px 10px; position: relative; top: 1px; } div.Tabs li a span { line-height: 1; font-size: 80%; padding: 0 3px; border-radius: 3px; -webkit-border-radius: 3px; -moz-border-radius: 3px; font-weight: normal; background: #F6F6F2; color: #4A7023; margin: 0 0 0 4px; } div.DiscussionsTabs div.SubTab { font-size: 11px; border-radius: 0; -moz-border-radius: 0; -webkit-border-radius: 0; border-top: 1px solid #aaa; background: #F6F6F2; margin:0; padding:4px 8px; } div.HeadingTabs ul { margin: 8px 0 0; } body.Discussion a.Bookmark { margin: 6px 2px; } div.Preview { border: 1px solid #aaa; background: #F6F6F2; margin:0 0 8px; padding: 8px; } .Foot { background: #F6F6F2; border: none; } div.MorePager a, div.MorePager a:link, div.MorePager a:visited, div.MorePager a:active, div.MorePager a:hover { border-radius: 0; -moz-border-radius: 0; -webkit-border-radius: 0; background: #F6F6F2; border: none; color: #4A7023; line-height: 1; padding: 0; text-decoration: none; } div.MorePager a:hover { color: #4A7023; text-decoration: underline; } body.add #Content { margin: 0 10px; background: #F6F6F2; } /* Panel Boxes */ #Panel div.Box { border-radius: 0; -moz-border-radius: 0; -webkit-border-radius: 0; box-shadow: none; -moz-box-shadow: none; -webkit-box-shadow: none; background: #F6F6F2; padding: 0; } div.Box h4 { color: #4A7023; } ul.PanelActivity, ul.PanelInfo { border-top:1px solid #ccc; } ul.PanelActivity li, ul.PanelInfo li, ul.PanelInfo li.Active { background: #F6F6F2; border-bottom: 1px solid #ccc; } ul.PanelInfo li.Active { background: #F6F6F2; } #Status { border-radius: 2px; -moz-border-radius: 2px; -webkit-border-radius: 2px; background: #eee; color: #000; line-height: 1.6; padding: 3px 6px; margin: 0 0 8px; } body.Profile ul.PanelInfo { border: #F6F6F2; } body.Profile ul.PanelInfo li { margin: 0; padding: 0; } body.Profile ul.PanelInfo li a { font-size: 12px; display: block; padding: 0 6px; background: #F6F6F2; } body.Profile ul.PanelInfo li a:hover { background: #F6F6F2; } /* Sign In Page */ body.Entry #Content { text-align: center; margin: 0 auto !important; } body.Entry #Content div.Box { background: #F6F6F2; border: 0; } div.Methods { border-left: 1px solid #ccc; } /* Messages */ div.DismissMessage { background: #F6F6F2; border: 1px solid #ccc; padding:6px 8px; border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px; } div.DismissMessage a.Dismiss:hover { color: #000; } div.Warning { background: #d00; border: 1px solid #b00; color: #F6F6F2; text-shadow: 1px 1px 1px #444; } div.Warning a.Dismiss { color: #F6F6F2; } #Content div.Box { color: #000; background: #F6F6F2; border: 1px solid #F6F6F2; } body#dashboard_entrycontroller_signin div.Box { border: none; } /* Autocomplete */ .ac_results { border: 1px solid #d7d8da; color: #000; border-top: 0; background-color: #F6F6F2; } .ac_results li { border-bottom: 1px solid #d7d8da; } .ac_lastitem { border-bottom: 0 !important; } .ac_results strong { background: #F6F6F2; } .ac_over strong { background: #F6F6F2; } .ac_over { background: #3b5998; color: #fff; } Having an issue with the background color in a div. The color shows up in I.E. but not in Firefox. I have a div with a width of 100%. Inside the div is an unordered list with two list items. Here is the css: div#nav { width: 100%; margin: 0; background-color: #EAE9E4; } #nav ul {margin: 0; padding: 0; } #nav li { list-style: none; float: left; margin: 0; padding: 0; width: 15%; font-size: 11px; line-height: 20px; white-space: nowrap; } Essentially this will be a navigation aid below the banner of the webpage. The list items will contain anchors which will appear as "buttons". The containing div extends to the end and I want it to have a background color. Any help appreciated. Hi, I have made a page using <div> tags. <div id="page"> <div id="leftmenu"> </div> <div id="mainarea"> </div> </div> My problem is that sometimes, the leftmenu is longer than the main area(1) and sometimes its the opposite- the main area is longer than the leftmenu(2). I want them both to be of the same height. (3) How can I do this? Plz Help! I have pasted the style codes for the 3 tags below. (1) (2) (3) #mainarea { background-color:#FFFFFF; float:left; position:relative; right:0pt; width:630px; } #leftmenu { background-color:#EEEEEE; float:left; left:0pt; position:relative; width:140px; } #page { background-color:#FFFFFF; position:relative; width:770px; } I have this transparent png image and it looks great on a web page when you put a background color on it. the only transparent part is the border, the rest is white, so the bg color is really for border. When you go to print it, however, printers dont normally show bg colors Is there some way how I can force printing the the bg color when the user prints the page? (I know some times u can configure that on their printer but I don't want them to have to do anything. ) for some reason my background color won't show in firefox.. http://losemybreath.org/ take a look in IE and then in FF, I can't for the life of me figure out why it's not working.. any ideas? this is the css Code: body { margin: 0; padding: 0; background: #ECF0CD; text-align: center; font: 12px Arial, Helvetica, sans-serif; color: #666; } #header { margin-left: 25px; width: 800px; height: 524px; background: url(http://www.losemybreath.org/images/greenlayout.jpg) no-repeat; } #center { margin: auto; width: 800px; } #content { width: 495px; margin: auto; text-align: left; background: #BCD4B2; } #blog { float: left; margin-left: 10px; width: 290px; text-align: justify; display: inline; background: #BCD4B2; } #sidebar { float: right; margin-right: 10px; width: 165px; text-align: justify; display: inline; background: #BCD4B2;} p { font: 12px Arial, Helvetica, sans-serif; color: #666; margin-top: 0; text-align: justify; } h1 { text-align: center; background-color: #ECF0CD; margin-bottom: 0; padding-bottom: 0; margin-top: 0; padding-top: 0; letter-spacing: 3px; font-weight: bold; font: 12px Arial, Helvetica, sans-serif; text-transform: uppercase; color: #77936C; } ul,li { list-style-type: none; margin: 0; padding: 0; } a:link, a:visited { color: #669257; text-decoration: none; } a:hover,a:active { color: #666666; background: #ECF0CD; text-decoration: underline; } hr { width: 100%; color: #ECF0CD; } .right { float: right; } textarea, select, input { color: #666666; background: #ECF0CD; border: 0px none; margin: 0px; padding: 2px; font: 10px Arial, Helvetica, sans-serif; } #question { border: 1px solid #ECF0CD; padding: 2px; } OK - I know all about the media="print" attribute. But I don't know how to force a background color (styled in a div tag; ie "background-color: black;") to print when the webpage is printed. I would think this would be a fairly common requirement but have not stumbled upon it. Also, it probably doesn't matter but I have been using Javascript to add the divs to the page dynamically, so I don't know if that would have any effect. Probably not. Any help would be appreciated. i have a problem dynamically setting the html background color when i initially set it with css. if i have a javascript function: function changeColor() { document.bgColor = '#FFFF00'; } and call it when i click a button the background color changes like you'd expect. but if i initialize the background color like this: body{background-color: #FF0000;} and then later call my javascript function to change the background color like before, it doesn't do anything. what's going on here? and how can i initialize the background color and still be able to dynamically change it? thanks I've been trying various fixes with my template, so that the grey background color in the sidebar, extends beyond the content to the bottom of the page. Alas... nothing is working. Here's my code: Code: #l_sidebar { color: #cccccc; background-color: #3a3a3a; width: 160px; float: left; float: left; margin-top: 0; margin-bottom: 20px; padding: 0 15px 15px 15px; } #l_sidebar p{ margin: 0px; line-height: 16px; padding: 0px 0px 5px 0px; } #l_sidebar h2 { color: #ffbfea; font-size: 18px; font-family: Verdana, Helvetica, Arial, Sans-Serif; font-weight: bold; list-style: none; padding: 10px 0px 10px 0px; margin: 0px; } #l_sidebar ul { list-style: none; margin: 0px; padding: 0px 0px 20px 0px; } #l_sidebar li { list-style: none; margin: 0px; padding: 0px; } #l_sidebar ul li { list-style: none; margin: 0px; padding: 6px 0px 5px 0px; } #l_sidebar ul li a { color: #c04080; text-decoration: none; } #l_sidebar ul li a:hover { color: #c04080; text-decoration: underline; } #r_sidebar { color: #c04080; background-color: #3a3a3a; width: 160px; float: right; position:relative; margin-top: 0; margin-bottom: 20px; padding: 0 15px 15px 15px; } #r_sidebar p{ margin: 0px; line-height: 16px; padding: 5px 0px 10px 0px; } #r_sidebar h2 { color: #ffbfea; font-size: 18px; font-family: Verdana, Helvetica, Arial, Sans-Serif; font-weight: bold; list-style: none; padding: 10px 0px 10px 0px; margin: 0px; } #r_sidebar ul { list-style: none; margin: 0px; padding: 0px 0px 20px 0px; } #r_sidebar li { list-style: none; margin: 0px; padding: 0px; } #r_sidebar ul li { list-style: none; margin: 0px; padding: 6px 0px 5px 0px; } #r_sidebar ul li a { color: #c04080; text-decoration: none; } #r_sidebar ul li a:hover { color: #c04080; text-decoration: underline; } I've been trying to figure out how I can use css to make one side of the body one color and the other side another color. For example: if I want the entire left 70% of the page to be white and the right 30% to be black. no margins. it needs to stretch the entire length of the page regardless if there's any content in a div or not. And it need to be fluid. I've been trying everything I know and apparently that's not very much because I can't figure it out. The link below is what I've tried using a bg image. Hopefull this will illustrate the idea. But I don't want to use a bg image if I don't have to plus the division where the color changes needs to be fluid with the text and I haven't figured out how to do it with the offset percentages. Basically the left side needs to be white as wide or wider as the left column and the right side color can go from that point all th eway right regardless of how wide the browser is. Does that make sense? I think I could do it if it were 50/50 but that's not what I'm after. http://sonicparke.com Has anybody done this or know how it should be done? |