CSS - Hot To Identify Different Styles For Different Links
I found this code somewhere for CSS buttons I'd like to use:
Code: <html> <head> <style type="text/css"> a:link, a:visited { float: left; margin: 2px 5px 2px 5px; padding: 2px; width: 200px; border-top: 1px solid #cccccc; border-bottom: 1px solid black; border-left: 1px solid #cccccc; border-right: 1px solid black; background: #cccccc; text-align: center; text-decoration: none; font: normal 10px Verdana; color: black; } a:hover { background: #eeeeee; } a:active { border-bottom: 1px solid #eeeeee; border-top: 1px solid black; border-right: 1px solid #eeeeee; border-left: 1px solid black; } </style> </head> <body> <a href="#">Content</a><a href="#">Photographs</a><a href="#">Events</a> </body> </html> My question is: Since this code defines styles for a:link, a:visited etc, how do I define styles for "normal" links in the rest of the page? That is, if I just wanted all links to be red (apart from the CSS buttons links already shown) how would I define that? Similar TutorialsIs it possible to set link styles that are defined inside of a heading tag... for example, h1 a:link{bleh} h1 a:visited{bleh} h1 a:hover{bleh} I tried it... but it doesn't want to go, I'm thinking I might have to think of another solution Hi, Ive got two gaps on my site that for the life of me I cant find out what is causing them. Ive even resorted to putting lots of margin: 0px; in the places I think might be causing it, but it doesnt help. I know my code isnt great, but im learning a lot, and I would apprecaite it if someone could help me understand why this is happening. Here is a link: http://www.zombiemod.com/rm/nina2/main.php?g2_itemId=14 The first space im trying to remove is between the main image and the thumbnails. The second space im trying to remove is between the thumbnails and the grey border at the bottom of the page. This is the CSS that may be relevant: Quote: #main-image-container #sliding-frame p { position: relative; /*height of yellow box overflow: hidden;*/ margin:0px; padding:0px; } #main-image { /*position: absolute;*/ z-index: -1; background-color: #111; } #thumbs-container{ /*margin:-110px auto 0 auto;*/ padding-left:0; padding-right:0; margin:0 auto !important; text-align:center; width:680px; } Can anyone offer some insight? Simple question, but i'm trying to create a decent sized space in between my links, and make them white. I can make my links white, but can't seem to change the space inbetween them. HTML Code: div id="bar-links"> <center> <div class="content box1"> <table width="500" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td colspan="4"><img src="images/barlist_01.gif" width="500" height="23" alt=""></td> </tr> <tr> <td background="images/barlist_02.gif" width="20"></td> <td background="images/barlist_03.gif" width="456"> </p> <div id="bar-links"> <h4><a href="#" title="Riley's Pub">Riley's Pub</a> <a href="#" title="Ho Down Bar"style="color: #fff">Ho Down Bar</a> <a href="#" title="Depot Square"style="color: #fff">Depot Square Bar</a> <a href="#" title="Egans Pub"style="color: #fff">Egans Pub</a> </h4> </div> </td> <td background="images/barlist_04.gif" width="24"></td> </tr> <tr> <td colspan="4"><img src="images/barlist_05.gif" width="500" height="27" alt=""></td> </tr> </table> </div> CSS Code: #bar-links { text-indent:inherit; text-align:left; } I'd like to seperate blocks of text with a horazontal rule. I'd like it to be dashed. So, I've come up with this: Quote: hr { border: none 0; border-top: 1px dashed #000; width:98%; height: 1px } However, although this works well in IE, it Firefox there is too much space between the HR and the text block under it. In other words, the text above the HR comes right up to the line, but the text under the line, there is a larger gap. Any way to close the gap? Any ideas? Hello -- new to this forum. My questions concerns a problem I've run into many times. I'm trying to be CSS-moral and use style sheets as much as possible, or a least place properties in the Header. But here's what I run into. Many times I find it necessary to have different properties for the same tag within the Body. Currently, I use CSS to create the Menu items at the top of each web page, an Unordered List, using the "li" tags. Ok, but I just discovered that by using a new CSS statement, I can use custom bullets in the Body's li tag: list-style-image : url(bullet.gif) . Cool!!! So, I went about making a little dog bone .gif and used it for my bullet graphic halfway down the page. Voila! It worked. Voila! I suddenly have dog bones in my menu (which I don't want !), which also use the li tag. I only know two workarounds. 1) is to go back to the BAD practice of using the taboo in-line style="images/dogbone.gif" in each li within the body and NOT put the statement in the Header style section or 2) at least try to use CSS in the header by making a class like li.bone { list-style-image : bone} and then repeat class="bone" for each li in the body, which is only slightly shorter than just putting in the style="xxx" in the first place. So, how do we handle using different style properties for the same tag within the body? Perplexed, Mike Unfortunately I am not very experienced and I am trying to edit some coding that has been done for me. The code is as follows <div title="[[TITLE]]" style='background-image: url ([bg]); padding: 5%; width:90%; height:100%; padding-left: 6%; padding-right: 6%; background-size: 100% 100%; '> Now what happens is the words I type in this box are beautifully laid out because of the padding... The images placed in the box should stretch border to border - but obviously don't because of the padding.... Can anyone please tell me what I can change to give my text padding but images with no padding? Thanks so much Basically, what i'm trying to work out is if the following is possible. Code: .mainBodyColor { background-color : #FFFFFF ; color: #000000; } .mainBodyFont10pt { font-size: 10pt; <mainBodyColor> } .mainBodyFont14pt { font-size: 14pt; <mainBodyColor> } where <mainBodyColor> is a nested call to the style in some way. etc etc etc How do i go about nesting/including the mainBodyColor styling within the mainBodyFont10pt style? I know that the following doesn't work Code: <font class="mainBodyFont10pt" class="mainBodyColor "> Some text to go in here</font> What I'm trying to do is have in one place the colour and include it into many styles, so if i want to change the colour scheme of the site i just have to change it in one spot and i know that the whole site will change. Thanks in advance. I have a page that I'm building as a prototype for a working medical exam GUI. I'm using Dreamweaver and it's pretty ugly. Is there anywhere I can download some styles that will bring this site to life? Maybe OSX or Vista-looking stuff? On the site I am starting, I am following the suckerfish style of using a ul/li menu. That works fine. A little position difference I have to figure out between IE and the real browsers but it does work. Problem I run into is when one of my pages includes a ul in the content. Using the css as is, that ul in content is displaying incorrectly. It should just go down the page but instead goes across the page. In the stylesheet, I tried making two li's, li.menu and li.info. That broke the menu but the content list worked. I tried adding .menu to various other components in the css but couldn't get both to work. I use php to include the code for the menu so I don't have to go to each page if I want to make a change. Could someone give me a hand on making two the two li's work from a style sheet so that both the menu and the content work on that page. Here are the pages. The web page: http://www.cacct.com/new/faq.php The stylesheet: http://www.cacct.com/new/css/sitestyle.css The menu code: http://www.cacct.com/new/php/menu.html This is the first page I built using other methods before changing to stylesheets: You can see what the content should look like. http://www.cacct.com/new/faq.html Thanks tk is it possible to modify the look of a checkbox input field with CSS? (background, check color, border, etc) thanks, --Lone What is the difference between inline styles and id's? Are there places where you should use one and not the other? Sorry if this has already been answered but I couldn't find anything in a search. I need a way to apply a different style to IE6 and IE7/Firefox. The webpage renders as expected in IE7/Firefox but IE6 needs to be fixed. Here is a mockup of what I need to have: Code: .featdesc { margin-left: 10px; margin-top: 10px; width: 400px; text-align: justify; if (ie6) font-size: 11pt; else font-size: 10pt; color: #505050; } Is there a way to accomplish this? Ok so what is the css substitute for the valign tag? Thanks! Hi, I remember reading that there is a css attribute for removing all browser-specific formatting from an element, for example forms, H tags and divs (which are pre-formatted differently in ie and firefox) but I can't recall what it was! Does anyone know how this is achieved as I find it very laborious when creating stylesheets to have to remember to reset all of these elements' formats. - before anyone says it, I know I could set up a generic, cross-browser-ready stylesheet for use with all my sites, and this is a system I already employ, I am simply concerned with saving bytesize and achieveing smaller stylesheets that are more easy to work with. I remember it was something like this: instead of: form{ margin:0px; padding:0px; } I'm sure you can do something like: form{ preformatting:none; } Does anyone know what I'm talking about? Or did I dream it?... cheers in advance I am hacking a clients css. Can someone tell me where I am going wrong. His site is a Smarty one. Here is the meta tags. The website is www.russiansweets.us and I am trying to format the links in the right nav menu underneath the search function that are presently red. I added class A.one:{} Class but it seems not to make a difference. I get the same color links before as after (red) Code: <html> <head> link href="stylenew.css" rel="stylesheet" type="text/css"> {literal} <style> A { COLOR: red; FONT-FAMILY: Arial, Verdana, Helvetica; FONT-SIZE: 11px; FONT-WEIGHT: bold; TEXT-DECORATION: none } A:hover { COLOR: #993300; FONT-SIZE: 11px; FONT-WEIGHT: bold; TEXT-DECORATION: none } // here is the part I added a.one { COLOR: #FFFFFF; FONT-FAMILY: Arial, Verdana, Helvetica; FONT-SIZE: 13px; FONT-WEIGHT: bold; TEXT-DECORATION: none } a.one:hoover { COLOR: #FFFFFF; FONT-FAMILY: Arial, Verdana, Helvetica; FONT-SIZE: 13px; FONT-WEIGHT: bold; TEXT-DECORATION: none } </style> //end of what I added {/literal} Here is the html Code: <td> <a class="one" href="disclaimer.php">Disclaimer</a> </td> I understand how to write a print.css style sheet, but I am unclear on how to use it. I want to have a link on my page that says "Printer Friendly Version" that displays the printer friendly version and lets them hit the print button on the browser to print it. I think this is the most common way to print a web page, right? So I am displaying to the screen first and the printer if they hit the button. So how do I get the print.css formatting to display instead of the screen version? Obviously I want a single markup file for both purposes. I am looking for a way to implement CSS styles on DropDownList ListItems. In HTML it's pretty easy: PHP Code: <select> <option class="red" value= "Yes">Option 1</option> <option class="pink" value= "No">Option 2</option> </select> But in ASP.NET-VB I'm hitting a snag. PHP Code: <asp:dropdownlist id="ddlList" runat="server" Width="180px"> <asp:ListItem Value="Yes" class="red">Option1</asp:ListItem> <asp:ListItem Value="No" class="pink">Option2</asp:ListItem></asp:dropdownlist> That code doesn't work. When compiled, it totally deletes the "class" attribute. Any thoughts? Hi folks. I am in the process of creating a feature in our Web application to allow users to create and manage a set of simple HTML email templates. At the bottom of my editor screen I show a preview of the formatted email (with the text and HTML entered into a textarea field). My problem is that when I output the preview to the Web page, it inherits all the styles from the parent page (for example an <h1> header has colors and special spacing, etc.). Is there a way to temporarily disable then re-enable the CSS styles defined in the header of the page so I can draw the "preview" with default browser CSS styles which will reflect more what an eMail program would look like? I am not sure if this can be done. If it could, it would be awesome and save me from having to code a special preview page or iFrame for the email template. i imagine this has to be one of the easiest questions, yet i have looked at tons of css table pages and cant find the answer. All im trying to do is create different styles for my tables on my website for example: Code: <table class="table1"> <tr> <td> </td> </tr> <tr> <td> </td> </tr> </table> <table class="table2"> <tr> <td> </td> </tr> <tr> <td> </td> </tr> </table> table 1 would have the following: black background white text underline text table2 would have the following: green background black text larger fonts the above colors are just an example, but my question is how would i do my CSS to support this if i wanted it to look this way? Thanks for any help. I have a header.inc and a css style sheet that are called to each page of a website via php. In the style sheet there are two styles that I would like to change depending on the section of the website. For example: in the style sheet css id "subnav" has background: #E8EDF5 and cssi id "subtitle" has background #E8EDF5 however in each major section of the website I would like to change the background colors of the divs that have id "subnav" and "subtitle". Is there type of php statement that I could place at the top of my website pages that would allow me to specify the colors of these two css ids? Hope I have made this clear. |