CSS - Can't Style Text Input When Using Javascript
Hey, I'm having a problem changing the background of a text input field to white. The problem seems to go away when I remove the javascript...I know next to nothing about javascript. Any ideas?
Code: <label for="email"> <input size=30 id="email" name="iemailaddress" value="Enter your email address here" onFocus="functionEmpty(this.form)" onBlur="emptyFill(this.form)" onKeypress="subEnable(this.form)"> </label> Code: input {background-color:white;} Similar TutorialsCan anyone tell me how to make a form text field one solid color? No border or anything, just a rectangle box any color. Thanks! Hi, Is it possible to style text on the same line like so.... T est Regards Chad I have this for my td tag: Code: <td bgcolor="#ffffff" onclick="window.location.href='...'" onmouseover="this.style.backgroundColor='#f1ffff'; this.style.cursor='pointer';" onmouseout="this.style.backgroundColor='#ffffff'"> I'd also like to add code to change the text color onmouseover. Can someone post how. Also, why is it different code to change a style when the code is embedded in an event as opposed to an external css file. For example to the change the background color of a <td> from a css file, it would be background-color, but internally its backgroundColor. This seems very conter-intuitive. Where can I find the available style options for the internal style. The W3C site only has for external and <style> tags in the header.Thanks! I'm having a problem getting the text in my nav bar to be formatted with my CSS sheet. ***HTML*** <div id="navbar"> <ul id="nav"> <li class="current_page_item"><a href="">Home</a></li> <li><a href="">Features</a></li> <li><a href="">Purchase</a></li> <li><a href="">Theme Demo</a></li> <li><a href="">Blog</a></li> <li><a href="">Affiliates</a></li> <li><a href="">Support</a></li> <li><a href="">Contact Us</a></li> </ul> </div> ***CSS*** #navbar { width: 960px; height: 47px; do not change Code: Original - do not change Code font-size: 12px; font-family: Tahoma, Geneva, sans-serif; color: #FFF; font-weight: bold; font-size: 12px; font-family: Tahoma, Geneva, sans-serif; color: #FFF; font-weight: bold; margin: 0px auto 0px; padding: 0px; } The text values aren't able to change for some reason, but the width and height values, padding, etc are. If someone could please help me trouble shoot that would be great. Thank you Paul I found this great website that shows me how to create these great buttons with some images. http://www.dynamicdrive.com/style/csslibrary/item/css_oval_buttons/ How can I do this with a button instead of a link??? Hi, I just can't seem to get my head around this one. I have a website title which appears on every page. The whole title is a link to the index page of the website. I want the second part of the title to be a h1 header with smaller font in a different colour. I also want the whole title to be on one line. I can only seem to get either all the words in the same font, or I can get the two parts to display their different fonts correctly, but they then appear on two lines, one under the other! My page code: <div id="garden-designer-title"><a href="(*website address*)" title="home">Joe Blogs</a><h1 style="display: inline'"><a href="(*website address*)" title="home">Garden Design</a></h1> </div> My stylesheet code: #garden-designer-title { position:relative; left:0px; top:0px; padding: 0; margin: 0; width:526px; height:51px; z-index:7; } #garden-designer-title a { position:relative; font-size: 46px; font-family: verdana, arial, helvetica, sans-serif; color: #009999; font-weight: normal; text-decoration: none; } #garden-designer-title h1 a { display: inline; font-size: 29px; font-family: verdana, arial, helvetica, sans-serif; color: #9482A4; font-weight: normal; text-decoration: none; } Does anyone know what I'm doing wrong?! Many thanks! I am at a total loss on this one. I'm trying to create a simple inline unordered list menu - no problems there - I've done that plenty of times. However, this time I would like my menu to have a border around it instead of being a plain box. As soon as I add the 'border-style:solid' modifier to the div, the text misaligns straight down, roughly 15px lines, out of the box. This happens on Firefox (and apparently on Opera as well, though I haven't checked that one myself). At this point I've stripped the page to bare bones, switched from transitional to strict, tried float vs not, tried margins vs 0 margins, and padding vs 0 padding, relative vs absolute, and attempted to manually shift the text through negative positions as well. No joy. Css: Code: /* Navigation */ #nav { width: 821px; height: 18px; border: 1px; border-style: solid; border-color:red; } #nav ul { } #nav li { display:inline; float:left; background-color:#9E0C0C; text-align:center; color:white; font-family: arial, san-serif; font-size: 14px; font-variant: small-caps; } and page: Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> <meta http-equiv="content-type" content="text/html; charset=utf-8" > <link href="style.css" rel="stylesheet" type="text/css" media="screen"> </head> <body> <div id="nav"> <ul> <li>Home</li> <li>XXX</li> <li>XXX</li> <li>CCC</li> <li>HHH</li> <li>JJJ</li> <li>kkk</li> <li>KKK</li> </ul> </div> </body> </html> (As I said, I've stripped it to absolutely nothing else.) Any suggestions would be welcome. (ETA: Also tried changing text size in case a too-large font size was making the text 'pop out' of the box. That is also not it.) is there a way to align the text inside a <input type="text" name="fff" > to the center? thanks for the help in advance As per suggestion, I have created a new thread in this forum. This is a follow on from my thread in the Javascript forum I have created a table which displays exactly how I want it to. It displays correctly in IE8, FF3.6, Opera & Chrome. What I've done is created some Javascript to remove the last column of the table. When this happens FF and Chrome (untested in Opera) redraws the table with the right edge column of the right-most column as I would hope it would - with the right edge style of the table as it was before the column was removed - in this instance, a solid black border. IE does not redraw the right border like this - it retains the internal column border, in this instance, a grey dashed cell border. I was wondering if there was a way to make IE behave? A demo is available at geostatsireland and it is a .com - the page name is mytable.html I have a disabled input field that is managed by PHP scripts. I need the fields to appear to the user but to look like just text. The main problem is that I have a patterned background on the page and I don't know how to create the style so that there is a transparent background on the input field. Can someone help? TIA. Hi. I think this is probably a simple question for you guys. I have a web page with lots of input text boxes. What I would like is when the cursor is in the text box, the background changes to yellow from white. And as an added bounus. Some are originaly grey to indicate required input and maybe even a difrent active colour. Lots of websites do this so must be simple. TIA Desmond. I wish all input-texts (input type="text") on my page to have a width of 200px, but I don't want any other input items, such as checkbox or button, to get this attribute. I tried the following in the style section, but it doesn't work. input.text { width:300px; } Note that the following DOES work, but it affects other input items as well, which I don't want: input { width:300px; } Any ideas would be welcome. Due to time constraints, no questions for further clarification of the problem will be answered. Thank you. Hi All, How can i apply style to following table? Class attribute is not working. following is the code. function links(){ var xmlDoc=new ActiveXObject("Microsoft.xmlDOM") xmlDoc.async="false"; xmlDoc.load("ticker.xml") ; xmlObj=xmlDoc.documentElement; nodes=xmlDoc.documentElement.childNodes; document.write("<table border=1 align=left >"); for( var count = 0; count<nodes.length; count++){ document.write("<tr>"); document.write("<td>"); document.write("<a href='" + (xmlObj.childNodes(count).getAttribute('URL')) + "'>" + (nodes.item(count).text) + "</a><br>"); document.write("</td>"); document.write("</tr>"); } document.write("</table>"); } Please guide me for the same. Thanks in advance Not sure if this is an HTML or CSS related question but here goes... googling gives me nothing. I have a form that I've built and on occasion one or two of the text fields may have text in side them but I've sent the text field to 'disabled' so that the user cannot change the information inside. The problem is is that some of my users are a little bit older and have a hard time seeing what is inside of the disabled text field because its already grayed out and the text inside is gray. Does anyone know if there is a way to change this or is it just a default with internet explorer? Thanks! Hi there, I have this basic CSS: Code: input.text { font-size: 11px; border: 1px #93A6C6 solid; background-color: #FFFFFF; color: #3F5674; font-family: Arial, Helvetica, sans-serif; } select { font-size: 11px; background-color: #FFFFFF; color: #3F5674; padding-right: 3px } textarea { font-size: 11px; border: 1px #93A6C6 solid; background-color: #FFFFFF; color: #3F5674; font-family: Arial, Helvetica, sans-serif; letter-spacing: 0px; word-spacing: 1pt; } The input box style isn't working correctly. The text I type in is coming out black and in a larger font than specified. If I just use style input rather than input.text it does work, but then it will put square borders around radio check boxes, which I don't want. Any ideas why it isn't working? This is the form it is being used on: Code: <form name="Albums Search" method="get" action="searchresults.php"> <table border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td><div align="center"> <input name="searchterm" type="text" tabindex="1" size="50" maxlength="75"> </div></td> <td rowspan="2" align="center" valign="middle"><div align="center"> <input type="submit" value="Search"> </div></td> </tr> <tr> <td><div align="center">Artist: <input name="searchtype" type="radio" value="artist" checked> Title: <input name="searchtype" type="radio" value="title"> Year: <input name="searchtype" type="radio" value="year"> </div></td> </tr> </table> <p> <textarea name="textarea"></textarea> </p> </form> Thanks How do I align an actual text input box to the center of the screen using css? This is driving me nuts.... You see how the text is a tad hight than the form input ? How do i make them align ?! Thanks. I want to create a div that goes right under an input, I can get it to look fine in FF but not IE using absolute positioning. Is there anyway I can position the new div relative to the input rather relative to containers around it? Hi! I'm in no way "new" to CSS and html, but I don't work with it on a regular basis. That said, what I'm trying to do, I would expect to work without too much trouble, but it's just not behaving like I'd expect. Seeing code is always a lot easier than trying to describe it, so here's the link to the page I'm trying to fix : chromocode.ca/test/ The issue I have is that the search box doesn't align with the image of the search button, even though they are the same height, and all elements (the input, the image, and its containing div) have 0 padding and 0 margin. I tried to put a top-margin of 2px on the image, that lowered the whole thing. Besides, it doesn't look exactly the same in IE7, Firefox and Chrome, so I don't want to start pixel-adjusting for each browser. Does anyone have any clue what I could do to fix this? HTML <div class="unitWide"> <div class="labelRight" id="appt"> Reaction</div> <div class="widget"><input type="text" name="Name" size="30"/></div> </div> <div class="unitAutoHeight"> <div class="labelRight">Description</div> <div class="widget"> <textarea name="comments"class="wideComment" rows="6" cols="28"></textarea></div> </div> CSS .unitSmall, .unitWide, .unitSmaller, .unitAutoHeight, .unitPair, .unitCal { float: left; z-index:1; width: 100%; height: 2.4em; padding-bottom: 6px; } .unitAutoHeight { height: auto; } input, .wideComment { font-size: 16px; padding: 3px; background: transparent; background-image: url(../images/inputbackground.png); border: none; color: #3f3f3f; font-weight: bold; width: 23.6em; } Hi y'all, Ive got form elements (here called 'units') stacked vertically and left floated to ensure alignment in a fixed-width form. Im trying to get the comment input box to stretch vertically, and add rows as the user inputs longer text. Basically I want to save space on the form by not specifying a predetermined number of rows (which is not the case right now, theres 6 rows), but to let it expand and not hide the overflow or worse, display a sidebar. Ive tried everything, looked in javascript forums, cant find it! Ideally it would behave like the new facebook message or wall post text box. Thanks |