CSS - Trying To Make A Clickable Box With Non-underlined Text
I'm trying to make a small box that is entirely clickable with text inside that is not underlined. Could someone explain to me why this code does not work, and what I need to do to fix it?
Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title></title> <meta http-equiv="content-type" content="text/html;charset=utf-8" /> <style type="text/css"> * { margin: 0; padding: 0; } body { font-family: helvetica; padding: 30px; } .box { width: 250px; height: 75px; padding: 40px 10px 10px 25px; background: #FFCE4E url('images/gradient_bg.jpg') repeat-x; border-radius: 5px; border: 1px solid #E8A935; } .box h3 { font-size: 19px; color: #333; padding-bottom: 5px; } .box p { font-size: 14px; color: #CC0000; font-style: italic; } a .box { text-decoration: none; } </style> </head> <body> <a href="#"> <div class="box"> <h3>Main text goes right here.</h3> <p>Smaller italicized text goes here.</p> </div> </a> </body> </html> Similar TutorialsI am trying to create a text box that has no border but has the entired box appear to be underlined. That is, I would like a 20 char box to appear like it has 20 underscores in it. However, I do not want to use a mask to do this, since I do not want any underscores in it. I want this to look like a host-based program. I don't want the text to show up as underlined as it's typed in, I would like it to appear just as an already underlined text box. So we can say that I want to record First Name and Last Name. so it would look like First Name:____________________ Last Name:____________________ Any ideas on how to do this? here is my code so far Code: input.termbox {color:#3333FF; background-color: #FFFFFF; font-family:Terminal; font-size: 15px; text-decoration:none font-weight: normal; border: none; I have some body text on a site I am working on. On Firefox and Safari the text appears with an underline even though it isn't set in the CSS to have this line. Strangely it doesn't happen in Internet Explorer 6. Also, it only happens on one page of the site in Firefox and Safari. This seems so simple, yet my hour of searching has yeilded nothing!! I simply want to make the numbers that appear for each <li> to be clickable. I tried moving the ,a> tags outside the <li>, but that doesn't work. I tried (to no avail) in CSS: li a {list-style-position:inside; } ans: ol li a {list-style-position:inside; } also i added a property that enabled me to click anwhere to the right of the number across the whole page, but I forgot now what that was. In the simplest illustration, I would like to be able to click on the no. 1 from the HTML code below. <ol> <li><a href="#a1" /></li> </ol> So I have a picture gallery/menu thing and I'm TRYING to make the list item actually clickable but I don't know how. It's probably easier to show you so on this page, I want the graphic that says 'click me!' to actually be a working link like you would expect from a menu item. http://www.thespinzone.com/temp/devcss.php Of course you can view the source to see the code but... The relevant css is: Code: #container {position:relative; width:204px; height:530px; margin:0px auto 0 auto; border:0px solid #aaa; background-image:url(portmenubg1.jpg) left no-repeat;} #container ul {width:204px; height:530px; padding:0; margin:0px; list-style-type:none; float:right;} #container li {float:left;} #container a.gallery span {position:absolute; width:1px; height:1px; top:1px; left:5px; overflow:hidden; background:#4C697B;} container a.slideb, #container a.slideb:visited {background:url(pb.jpg); display:block; color:#000; text-decoration:none; border:0px solid #000; margin:34px 0px 24px 42px; text-align:left; cursor:default;} #container a.slidec, #container a.slidec:visited {background:url(pc.jpg); display:block; color:#000; text-decoration:none; border:0px solid #000; margin:20px 2px 22px 4px; text-align:left; cursor:default;} #container a.slided, #container a.slided:visited {background:url(pd.jpg); display:block; color:#000; text-decoration:none; border:0px solid #000; margin:22px 0px 22px 80px; text-align:left; cursor:default;} #container a.slidee, #container a.slidee:visited {background:url(pe.jpg); display:block; color:#000; text-decoration:none; border:0px solid #000; margin:22px 0px 22px 8px; text-align:left; cursor:default;} #container a.slidef, #container a.slidef:visited {background:url(pf.jpg); display:block; color:#000; text-decoration:none; border:0px solid #000; margin:22px 0px 22px 46px; text-align:left; cursor:default;} #container a.gallery,slideb:hover {height:54px; width:120px;} #container a.slideb:hover {background:url(pclickme.jpg); border:0px solid #fff;} #container a.slidec:hover {background:url(pclickme.jpg); border:0px solid #fff;} #container a.slided:hover {background:url(pclickme.jpg); border:0px solid #fff;} #container a.slidee:hover {background:url(pclickme.jpg); border:0px solid #fff;} #container a.slidef:hover {background:url(pclickme.jpg); border:0px solid #fff;} #container a.gallery:hover span {position:absolute; width:300px; height:200px; top:10px; left:204px; color:#000; background:#fff;} #container a.gallery:hover img {border:1px solid #000; float:left; margin-right:5px;} #container a.slideb:hover img, #container a.slidei:hover img {float:right;} and the html is: Code: <div id="container"> <ul> <li><a class="gallery slideb" href="#nogo"><span><img src="pb1.jpg" alt="clickme" title="B" /></span></a></li> <li><a class="gallery slidec" href="#nogo"><span><img src="pc2.jpg" alt="clickme" title="C" /></span></a></li> <li><a class="gallery slided" href="#nogo"><span><img src="pd1.jpg" alt="clickme" title="D" /></span></a></li> <li><a class="gallery slidee" href="#nogo"><span><img src="pe1.jpg" alt="clickme" title="E" /></span></a></li> <li><a class="gallery slidef" href="#nogo"><span><img src="pf1.jpg" alt="clickme" title="F" /></span></a></li> </ul> </div> Is there a common cause of non-clickable text? I mean that on the suckerfish style menus I can't click on text in the link items. I thought it was a z-indexing issue but apparently not. I have encountered this problem many times now and am not sure how to fix it. I would like to pop up the text, that is, make it bigger when the user hovers on it. but the problem everytime the text gets bigger, the whole row moves and the surrounding texts gets displaced. any idea ? tutorial? let me know if i need to explain more. I have a div on a web page set up so that all the links inside that div should not be underlined. Works great on every OS and browser I have tested it on... except one particular computer running Windows XP and Internet Explorer 8. That computer shows the links underlined. Other computers running Windows XP and Internet Explorer 8 show the links not underlined as intended. Is there some kind of personal browser setting in Win/IE8 that overrides the style sheet? I looked in Internet Options and found the option to underline links Always/Hover/Never, but that option seems to be set to always by default, and does not override the style sheet on other computers. Hello, a bit of a .css n00b and needs your help. After changing a .css sytle sheet to suit my a needed color shceme the links become underlined when the color is changed. Anyone willing to to tell why. Any help appreciated. A sample of the link code: /*- Links */ #primary a:hover, #primary a:visited:hover, .secondary a:hover, .secondary a:visited:hover { text-decoration: none; } h2 a:hover, h2 span a:hover { color: #423525 !important; <!---27d to 423525 --> text-decoration: none; } a{ color: #423525C; <!---27d to 423525 --> text-decoration: none; } .itemtext a:visited { color: #b41; } Thanks. I've got two questions of which one is to gather some opinions to help me decide what's best. 1) color notation in CSS: Any recommendations as to what notation I should use? examples: color: rgb(255,234,0) color: slateblue color: #FF99CC color: #F9C Is there some recommendation here? I'm quite used to the long hex notation e.g. #FF99CC. Is the short notation also very much accepted? And should I be using those at all or should I prepare myself with a new site to switch to rgb(). 2) text-decoration yes or no? I was thinking the following: A) when it's absolutely clear that some text presents a link, like e.g. in a menu or some newscolumn with a brief description and a bold title, then it's "okay" to set text-decoration: none. Maybe an underline or colorchange when hovering. B) When it's not absolutely clear what's a link, like some word in a paragraph text, use underline or at least some other colour which is consistent over the website for being a link. Also, with point B I was thinking of choosing: A new link: text-decoration with color and text-decoration gone with hover, for a nice effect. With a visited link: I) text-decoration but normal paragraph color and again text-decoration gone when hovering OR... II) no text-decoration, but still with that color and text-decoration when hovering. It troubles me coz I can't make up my mind. Something keeps telling me that I should try to keep those text-decorations like with B-I and simply remove the colour, instead of relying on colour to indicate a link. So forget about B-II?! Ah, it was this site which works on my conscious not to rely on color for links: http://lists.w3.org/Archives/Public/www-style/2003Mar/att-0002/01-part#colorunits Anybody got some comments or tips? And yes also some tip on the CSS I want things to be "user-friendly" enough, but this also means that I don't want text to be broken up too much. Some people even suggested that I should take ALL links out of the paragraph and simply mention them below the paragraph. All good points, but which way to go Hello All, I have an image with a text label to the right that is linked. Now, I want a little whitespace between the image and the text, so that the text doesn't butt up right against the image. To accomplish this, I could use a non-breaking space ( ) However, the space then becomes part of the link and it gets underlined. So, by adjusting the image's margin (or padding) CSS, I can achieve the desired result... at least in Internet Explorer. Firefox/Safari/Chrome seem to underline a linked image's margin as well. I tried using "padding" CSS instead, but produced the same result. How can I get Firefox/Safari/Chrome to underline JUST the text in a link, and not the image (and it's margin) as well? This is how the code is displayed in IE: http://img407.imageshack.us/img407/2360/pfieeu9.jpg Firefox/Safari/Chrome: http://img407.imageshack.us/img407/5421/pffirefoxvv1.jpg You can see the little extra "nubbin" of underline between the icon image and the text. CSS: Code: a.red10ullink:link {color: #a80000; font-size: 10pt; font-family: arial; text-decoration: underline;} a.red10ullink:visited {color: #a80000; font-size: 10pt; font-family: arial; text-decoration: underline;} a.red10ullink:hover {color: #333333; font-size: 10pt; font-family: arial;} img.icon {vertical-align: middle; border-width: 0px; margin: 0px 5px 0px 0px;} HTML: Code: <a href="somepage.html" class="red10ullink"><img src="icon_pf.gif" alt="" width="20" height="20" class="icon" />Printer Friendly</a> Thanks! I know it's really easy but i forgot how to do it! Please post the code here thanks! Currently I have this: <div style="padding:5px; overflow:auto; border:1px solid #c0c0c0; font-size:13px; background: #EEE;"> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd </div> I want to make it so that it will always stay on 1 line, and a horizontal scroll bar will appear if the window gets too narrow. How can I do this? edit: I can't use <pre> tags because the destroy the formatting in a more annoying way. In the html below I want to make the text more narrow (to gert the letters cloer to each other). I read about Css-property font-strech but I cannot get it more narrow. Could someone help? Or is there another way to achieve this? This is the HTML: Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> <style type="text/css"><!-- h1 { color: #D16700; font-weight: 700; font-size: 56px; font face: Arial; text-align: left; text-decoration: none; line-height: 66px;} h2 { color: #D16700; font-weight: 700; font-size: 56px; font face: Arial-black; text-align: left; text-decoration: none; line-height: 66px; } h3 { color: #D16700; font-weight: 700; font-size: 56px; font face: Arial-black; text-align: left; font-stretch: ultra-condensed; text-decoration: none; line-height: 66px; } --> </style> </head> <body> <H1>Communication Training</H1> <H2>Communication Training</H2> <H3>Communication Training</H3> </body> </html> Like when I make a field.. <fieldset> <fieldset> How can I then make something like, when typing in <text> it'll stay in a locked field. And when clicking "Save" it will send the text to my email? Please help. Would be really cool with a code below. Issue is I've got text that I want in a certain place on the page. I've run into this situation time and time again, thankfully I've always worked out a creative solution, however I've just been avoiding the problem. It's not something I can use center, or bottom or anything like that on. I've got an image that's in sort of an odd position on the page. I want to have a link directly centered under that image but I can't seem to get the text where I want it. Any suggestions? I am very, very new at web design, and would like to make a colored background behind text, although I am sure that is not the right name for it! For example, in this this website I would like to emulate how to make that curved rectangular background behind the Online Poll, but I have no clue what the name or the source code behind it that makes it so! If anyone could even just give me the proper name for it so I can google it, I would be very thankful! In the HTML below I use divs contentleft, contentcenter and contentright. Because the text under the Header Contentright is so long I would like to make a scrollbar for the text of contentrigth but withoud the Header contentrigth, so that you alwaus see the header when scrolling the text. Is this possible with these content-codes? This is the HTML I have so far: Code: <head> <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> <meta name="generator" content="Adobe GoLive 4"> <title>glish.com : CSS layout techniques : static width and centered</title> <style type="text/css"><!-- #contentcenter { background-color: #eee; float: left; padding: 0px; width: 300px } #contentheader { background-color: #fff } #contentheader h1 { font-size: 14px; margin: 0px; padding: 16px } #contentleft { background-color: #fff; float: left; padding: 0px; width: 175px } #contentright { background-color: #fff; float: left; padding: 0px; width: 175px } #contentright p { font-size: 14px } #toptext { text-align: left; margin-top: 10px; margin-right: auto; margin-left: auto; padding: 0px; width: 650px } body { text-align: center } h1 { font-size: 14px; margin: 0px 10px 10px; padding-top: 10px } p { margin: 0px 10px 10px }--> </style> </head> <body> <div id="toptext"> <div id="contentheader"> <h1><a href="home.asp">Top Text</a>, page with three columns: left, centered, right.</h1> </div> <div id="contentleft"> <h1>Header Contentleft</h1> <p class="greek">This is the left column</p> </div> <div id="contentcenter"> <h1>Header Contentcenter</h1> <p>This is the center column</p> </div> <div id="contentright"> <h1>Header Contentright</h1> <p>This is the right column. Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla. Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla. Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla blaBla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla. Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla Bla bla bla bla bla</p> </div> <p><br clear="all"> <!-- without this little <br /> NS6 and IE5PC do not stretch the toptext div down to encopass the content DIVs --> </div> </body> </html> Hey folks, i'm trying to get the effect of the following image: http://www.dgemu.com/Images/first_steps.jpg Basically I got it all set up 'cept for Metroid's image, which is just driving me insane.. I used absolute positioning on the metroid image so I could use relative positioning on that table thingy and use z-index to put it there, but I'm having problems with the text - it goes behind the image ahhhh - what can I do? I was thinking perhaps adding relative positioning for the text too and make it above the image but what I want is to not touch the image - u know like u do float:right on the image - but I can't use float 'cuz then the z-indexing thing messes up.. hmm.. can anyone help me? ok. Ive been trying to use CSS to style my page instead of tables. but I cant get stuff to line up right. basically I have a div spanning the whole width of a css box. inside that div I have 3 sections, one for left-aligned text, one for center aligned text and one for right aligned text. what I want is to display on the far left a left arrow image (for use as a button) and the word 'Previous'. then in the middle of the div, center aligned, I want to display the words 'select a different draw' and on the right hand side, right aligned I want the word 'Next' followed by my right arrow. EASY PEASY I thought. Well it has taken me an hour to realise that I have to set my parent element to position: relative for the left middle and right elements to use absolute without going to the very top of the page. so at least I now have them along in a line. What I have found is that the the text on the left and right is vertically aligned to the BOTTOM edge of the image and the text in the middle has been vertically aligned to the TOP of the image despite all 4 css classes being defined as vertical-align: middle; please tell me where I am going wrong, I'm loosing my marbles here! --html: Code: <div id="width-100"> <div id="third-left"> <img src="images/arrowleft.png" alt="foo"/> Previous </div> <div id="third-middle"> Select a different draw </div> <div id="third-right"> Next <img src="images/arrowright.png" alt="foo"/> </div> </div> --css: Code: #third-left { width: 30%; text-align: left; vertical-align: middle; } #third-middle { position: absolute; top: 0px; margin: 0 35% 0 35%; width: 30%; vertical-align: middle; text-align: center; } #third-right { position: absolute; top: 0px; right: 0px; width: 30%; text-align: right; vertical-align: middle; } #width-100 { width: 100%; position: relative; vertical-align: middle; background: white; } any thoughts? Thanks, Ben |