CSS - H1 With Different Font Style Embedded In A Single-line Text 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! Similar TutorialsGreetings, I have a class called "header" and I am trying to give it a touch of extra space between it and the next line. All of my headers are just a few words and thus on one line. I tried placing "line-height: 1.5em" in my "header" class and it shows up correctly in Dreamweaver but not in IE. My thought is, because it is only a single line, that class value does not kick in because there is no second line for that class. Is there a way to conrol this in CSS or am I going to have to resort to using a....gulp.....spacer? Thanks in advance! Hi everyone, Basically I am working on a yahoo store design, and I have learned through working with Yahoo Store that it is very proprietary and limited in access. They allow me to access external style sheets and some of the layout of the site but I found for a specific tag id that if I alter it's margin value, something in the inaccessible backend creates an embedded style for that tag that overrrides the external style sheet. Yahoo help has been no help because they don't support custom code. Anyway, I was wondering if there was a way to override or disable an embedded style in general or for a specific tag? I am pretty sure there isn't, but if there is, I would be forever grateful. I would especially appreciate any non-javascript solutions. I think javascript could do the trick but a non-javascript solution would be preferable and that is what I'm looking for. Thank you anyone who can help out. -Greg Hi Please look at this test page of site in progress. http://thetransactiongroup.net/advisor/NEW/index.asp On the left side there is a graphical/stylesheet based nav panel. When you hover over the seventh button from the top, the popout navigation is double spaced. How can I make it like the others: single spaced? Here is the stylesheet for that section of the nav, including my unsuccessful attempt to make it single spacing: #nav li.m7 { background: url("m7.gif") -190px 0 no-repeat; } #nav li.m7 a { background: url("m7.gif") 0 0 no-repeat; height:32px; line-height: normal; } #nav li.m7 a:hover { background-image:none; } #nav li.m7 ul li a { background-image:none; } --- below is complete stylesheet: #nav { padding: 0; margin: 0; width: 190px; } #nav li { list-style: none; position: relative; float: left; margin-bottom: -1px; width: 190px; } #nav a { width: 190px; display: block; height:20px; } #nav li.m1 { background: url("m1.gif") -190px 0 no-repeat; } #nav li.m1 a { background: url("m1.gif") 0 0 no-repeat; } #nav li.m1 a:hover { background-image:none; } #nav li.m2 { background: url("m2.gif") -190px 0 no-repeat; } #nav li.m2 a { background: url("m2.gif") 0 0 no-repeat; } #nav li.m2 a:hover { background-image:none; } #nav li.m3 { background: url("m3.gif") -190px 0 no-repeat; } #nav li.m3 a { background: url("m3.gif") 0 0 no-repeat; } #nav li.m3 a:hover { background-image:none; } #nav li.m3 ul li a { background-image:none; } #nav li.m4 { background: url("m4.gif") -190px 0 no-repeat; } #nav li.m4 a { background: url("m4.gif") 0 0 no-repeat; } #nav li.m4 a:hover { background-image:none; } #nav li.m4 ul li a { background-image:none; } #nav li.m5 { background: url("m5.gif") -190px 0 no-repeat; } #nav li.m5 a { background: url("m5.gif") 0 0 no-repeat; } #nav li.m5 a:hover { background-image:none; } #nav li.m5 ul li a { background-image:none; } #nav li.m6 { background: url("m6.gif") -190px 0 no-repeat; } #nav li.m6 a { background: url("m6.gif") 0 0 no-repeat; } #nav li.m6 a:hover { background-image:none; } #nav li.m7 { background: url("m7.gif") -190px 0 no-repeat; } #nav li.m7 a { background: url("m7.gif") 0 0 no-repeat; height:32px; line-height: normal; } #nav li.m7 a:hover { background-image:none; } #nav li.m7 ul li a { background-image:none; } #nav li.m8 { background: url("m8.gif") -190px 0 no-repeat; } #nav li.m8 a { background: url("m8.gif") 0 0 no-repeat; height:36px; } #nav li.m8 a:hover { background-image:none; } #nav li.m9 { background: url("m9.gif") -190px 0 no-repeat; } #nav li.m9 a { background: url("m9.gif") 0 0 no-repeat; } #nav li.m9 a:hover { background-image:none; } #nav li.m9 ul li a { background-image:none; } #nav li.m10 { background: url("m10.gif") -190px 0 no-repeat; } #nav li.m10 a { background: url("m10.gif") 0 0 no-repeat; } #nav li.m10 a:hover { background-image:none; } #nav li.m11 { background: url("m11.gif") -190px 0 no-repeat; } #nav li.m11 a { background: url("m11.gif") 0 0 no-repeat; } #nav li.m11 a:hover { background-image:none; } #nav li.m12 { background: url("m12.gif") -190px 0 no-repeat; } #nav li.m12 a { background: url("m12.gif") 0 0 no-repeat; } #nav li.m12 a:hover { background-image:none; } #nav li.m13 { background: url("m13.gif") -190px 0 no-repeat; } #nav li.m13 a { background: url("m13.gif") 0 0 no-repeat; } #nav li.m13 a:hover { background-image:none; } #nav li.m14 { background: url("m14.gif") -190px 0 no-repeat; } #nav li.m14 a { background: url("m14.gif") 0 0 no-repeat; } #nav li.m14 a:hover { background-image:none; } #nav li.m15 { background: url("m15.gif") -190px 0 no-repeat; } #nav li.m15 a { background: url("m15.gif") 0 0 no-repeat; } #nav li.m15 a:hover { background-image:none; } #nav li.m16 { background: url("m16.gif") -190px 0 no-repeat; } #nav li.m16 a { background: url("m16.gif") 0 0 no-repeat; } #nav li.m16 a:hover { background-image:none; } #nav li.m17 { background: url("m17.gif") -190px 0 no-repeat; } #nav li.m17 a { background: url("m17.gif") 0 0 no-repeat; } #nav li.m17 a:hover { background-image:none; } #nav li.m17 ul li a { background-image:none; } #nav li.m18 { background: url("m18.gif") -190px 0 no-repeat; } #nav li.m18 a { background: url("m18.gif") 0 0 no-repeat; } #nav li.m18 a:hover { background-image:none; } #nav ul { padding: 0; margin: 0; width: 240px; border:1px solid #555; background-color:#fff; position: absolute; visibility:hidden; left:auto; margin-left: 189px; margin-top: -22px; } #nav li ul.double { margin-top: -32px; } #nav li ul li a { width: 230px; border-top:1px solid #fff; border-right:1px solid #555; border-bottom:2px solid #555; border-left:1px solid #fff; color:#000; height:17px; line-height:17px; text-decoration:none; padding-left:10px; background-image:none; } #nav li:hover ul, #nav li.sfhover ul { visibility:hidden; } #nav li:hover ul, #nav li.sfhover ul { visibility:visible; } Hi all. I am in the process of re-coding some beautiful email templates that were pure CSS layouts into nasty HTML nested tables so our clients can still see our newsletter when viewing them in Web based email browsers like Yahoo, GMail, etc. (since these often strip out our CSS sections) Typically we would define our link styles in CSS using something like: PHP Code: a, a:link, a:visited { color: #BF28B2; text-decoration: none; font-weight: bold; } I just realized I am not sure how to represent the same style when using inline styles such as <span style='...'>text</span>. Just what can I do to modify the link styles using inline styles? Thanks I am using style sheet for fonts etc. I was wondering is it OK to use style sheet and <Font> tags at the same time on a page. I mean if you are using certain font only once. Why bother creating a class in style sheet and then calling using that class .. Hi! I have a problem at andreaspohlmann.com with an (on win7) IE8 Problem, same problem on XP for FF and IE. The text underneath the start images should be the same format as the text underneath any of the gallery pics: see http://www.andreaspohlmann.com/wirtschaft/daimler/ difference between the two is first is nested 2 divs further, due to the slideshow and has a class instead of the id the style that should be applied is: (i used everything I could think of to disable inheritance) #bu h1, .bu h1, .caption { font-family:"Arial", Helvetica, sans-serif; background-color:none; color: #000; text-decoration: none; word-spacing: normal; text-align: right; letter-spacing: 0; text-indent: 0; line-height: 10px; font-size: 10px; font-weight: bolder ; font-style: normal; text-transform: lowercase; display:block; } Still IE8 makes it look smaller, adding 1px makes it too large. the styles seem to be exactly the same in the IE developer thingy. I'm at a loss, any help apreciated. Cheers, Chris. Greetings, I am relatively new to CSS and am using background image bullets. Problem is, in the case of a two line link, the bullet aligns in between the two lines and I need it to align to the top line. Below is the CSS, and attached is a screenshot of the link to better illustrate my predicament. Thanks for any help! li { list-style-type: none; background: url(../images/bullet.gif) no-repeat left; padding: 0 0 0 10px; } Hello, I created the following header: http://www.27lamps.com/Beta/Typography/Typography.html Where Font Size is the same as Line Height: 2.0em. Shouldn't the border be next to the text? Thanks, Miguel Hi, Tried using Pseudo Elements to set style property for first character (first-letter) and first line (first-line) inside an element. Every thing works fine when we set such styles on div or table elements, but failed on anchor tags Working on Code: <style> div:first-letter{font-weight: bold;} </style> <div> Pseudo Div<br> Line Two<br> Line Three<br> </div> Failed On Code: <style> a:first-letter{font-weight: bold;} </style> <a href=""> Pseudo Div<br> Line Two<br> Line Three<br> </a> Can anyone give me the solution for this. Thanks in advance! I have not done much web designing lately and have forgoten a number of things. Right now i cannot remember if it is possible to specify link styles for a specific class for a cell in a table. I have this code for the entire page: a:link,a:active,a:visited,a:hover { color : #FFFFFF; text-decoration: underline; } However, I want to have it different in only a specific cell of a table. Is there a way to put it in the following code? td.newshead { background-color: #013501; border-style: solid; border-color: #FFFFFF; border-bottom-width: 1px; border-top-width: 1px; border-left-width: 1px; border-right-width: 1px; font-family: verdana; font size: 125%; font-variant: small-caps; font-weight: bold; color: #FFFFFF; text-align: center; } I can't do something like making another link class like this either a.class:link,a.class:active,a.class:visited,a.class:hover { color : #013501; text-decoration: underline; } I have the information comming from another page and I am not able to the <a class="class" href="url">. I need to put it in the style for the cell. Anyone able to help me out here? hi, i have this style for a div hover effect, but how cani stop my other links having this efect? i want 2 different link styles. Code: <style type="text/css"> a:link { text-decoration:none; color:#000000; background:#B1DB9D; width: 200px; display:block; } a:active { text-decoration:none; color:#000000; background: #A2D389; width: 200px; display:block; } a:visited { text-decoration:none; color:#000000; background:#B1DB9D; width: 200px; display:block; } a:hover { text-decoration:none; color:#000000; width: 200px; background: #A2D389; display:block; } </style> Any ideas? I know how to use the class etc but i can't get he link part right. Thanks Hello, While testing a site in different browsers/systems, I've found the need to have a suitable replacement for Arial Narrow. Since font-stretch doesn't work (not implemented?), I need a widely available substitute. I've thought about font embedding, but all those articles out there with demos, I can't get them to work with Firefox. So I'm guessing Firefox simply doesn't support font embedding? Is there a way to make font embedding work? The other issue I'm having trouble with, how to make the link outlines disappear in IE? I've added :active, :focus { outline: 0 } to my stylesheet, and it works great in Firefox, however, IE insists on displaying an outline on the links. Any advice on these issues? I have a webpage that has a Link tag that links to a style sheet Code: <html> <head> <link rel="stylesheet" type="text/css" href="http://cdn-media.madaboutbrighton.net/css/main-min-v1.4.css" /> </head> <body> Test 0.0.1 </body> </html> However, when viewing the source of this page in IE, Chrome and Firefox the Link tag has transformed into a Style tag which contains a dump of the linked style sheet Code: <html> <head> <style type="text/css" style="display:none">body... whole style sheet content dumped in here...</style> </head> <body> Test 0.0.1 </body> </html> This is a fairly old site, and nothing has changed recently. But when i first published the site the Link tag appeared normally. I have tried passing it a css file with no content or with just one definition in it, but it keeps changing the Link tag into a Style tag. I obviously don't want the css dumped into a Style tag each time as this is very inefficient and bypasses all my caching/expires settings. You can see an example of this here madaboutbrighton.net/test This is not an isolated case and is effecting some but not all sites on my webserver, which were all displaying correctly the last time i checked but now have this problem. Even though all sites have the same settings. I am baffled. All ideas most welcome, or even just let me know if you are having the same problem. Cheers!!! I have one css file which is linked to all my html pages That css file defines a style for all my <a> tags ie - a:link, a:visited, a:hover etc. Theres one html file where i need a different style for some of the <a> tags ive set a sepecific class on these tags ie: <a class="set1" etc and in my css file ive tried the following .set1 a:link { etc } but for some reason this doesnt override the style on the generic a tags ie it seems to keep using a:link { } ignoring the .set1 a:link { etc } help! i want to have two seperate styles for links on my page - how can i do this. i am using dreamweaver. i can only work out how to use one link style, i.e. the a:hover etc.. i copied some of this code from a page i liked. all it is is a background image and i want to type text over it that is in a table. the problem is i cannot center my text ("<?=$information[nickName]?>"). the text always is on the left, never in the center. i have tried different things such as <td align=center> as opposed to the <td valign=center> the other author has in the 2nd block, the align:center does not work with font. and i have tried appending a ;text-align:center within that SPAN tag, but that does not work either. does anyone have any advice??? thanks! <table border=0 cellspacing=0 cellpadding=0 width="750" style="border: solid black 2px;"> <tr><td style="background-image:url(images/name_test.jpg); background-attachment: 100% 0%"> <table border="0" cellspacing=0 cellpadding=1><TR><TD valign="center"><SPAN style="font-size: 14pt; font-family: arial black, helvetica; padding: 3px; align: center;"><?=$information[nickName]?></SPAN></TD></TR> </table> I have a menu where the submenu li's have a blue/darker blue background color and hover color. I have one set of submenu items where I would like to change the background and hover colors for that set only, but haven't been successful in writing the second set of code, the original colors still show up Here's the part of my styles for the list that I'm trying to change.. Code: /* original backgrounds for the menu */ ul.menu li ul li a { background: #ccc; color: #000; padding-left: 20px; } ul.menu li ul li a:hover { background: #aaa; border-left: 5px #000 solid; padding-left: 15px; } Is it the way I tried to rename the style? Code: /* change backgrounds to shades of green for one sub menu */ .green ul.menu li ul li a { background: #afe4bf; color: #000; padding-left: 20px; } .green ul.menu li ul li a:hover { background: #88b796; border-left: 5px #000 solid; padding-left: 15px; } thanks in advance for any help, Kathy Can someone tell me why css style settings for links won't effect a mailto: link? Is there anyway to make it happen without individually coding style into each mailto: link? Thanks, HeadElf Hello, My unvisted links within a div section are not working, they default to Red which is set up in the CSS as a catch-all. I see this happenning with IE 6.x and FireFox 1.5 and netscape 7 Example HTML code where the unvisited link appears in Red and it should be in Grey: Code: <div class=medGray> <a href="/data/tmp/E300vV60cB.s5ukal.diblu.tmp">Download</a> extracted device records (4 records). </div> Here's my snippet from my CSS file: Code: a.medGray:link { text-decoration: underline; FONT-SIZE: 12px; COLOR: #666666; FONT-FAMILY: Verdana, Tahoma, sans-serif; } a.medGray:visited { color:#666666; } a.medGray:hover { text-decoration: underline; } a.medGray:active { color:#666666; } /*-- Default Red--*/ a:link { text-decoration: underline; font-family:Verdana, Arial, Helvetica; font-size:12px; color:#CC0000; } a:visited { color:#999999; } a:hover { text-decoration:underline } a:active { color:#CCCCCC; } |