![]() |
Re: CSS can you suggest?
hey guys, I have a few probs, with css again, but I will do this one at a time.
first of all if I have a tabel and in the table data i have made the contents be justified using css, can I make a span with its own unique id to have different attributes. e.g. css td {border:2px; text-align:justify;} span#bc {font-weight:bold; text-align:center;} <table> <tr><td><span id="bc">heading</span><br> I want the above heading to be centred in the table data cell but have this all justified, is it possible? </td></tr> </table> or because I have the td justified the span is overridden? ik |
Re: CSS can you suggest?
ok I have a question for some of the IE faithfull,
why is it that this page does not look the same as in firefox? what do I have to do to make it work the same in IE as in Firefox? here is the code. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE> test page </TITLE> <style type="text/css"> body {background-color:#D0BFAC; color:#000000; font-size:12pt; font-family:TimesRoman,Arial;text-align:center; margin-left:1cm; margin-right:1.5cm; font-weight:bold;} a:link {color:#0000FF;} a:visited {color:#FF0000;} a:active {color:#FFFF00;} a:hover {color:#008000;} hr {width:95%; height:2px; color:#C0C0C0;} a:link[href="white.html"] {color:#FFFFFF;} a:link[href="blue.html"] {color:#0000FF;} a:link[href="orange.html"] {color:#FFA500;} a:link[href="green.html"] {color:#008000;} a:link[href="yellow.html"] {color:#FFFF00;} a:link[href="purple.html"] {color:#800080;} a:link[href="brown.html"] {color:#A52A2A;} a:link[href="black.html"] {color:#000000;} span.white:hover {background-color:#FFFFFF; color:#000000;} span.blue:hover {background-color:#0000FF; color:#FFFFFF;} span.orange:hover {background-color:#FFA500; color:#000000;} span.green:hover {background-color:#008000; color:#FFFFFF;} span.yellow:hover {background-color:#FFFF00; color:#000000;} span.purple:hover {background-color:#800080; color:#FFFFFF;} span.brown:hover {background-color:#A52A2A; color:#FFFFFF;} span.black:hover {background-color:#000000; color:#FFFFFF;} </style> </head> <BODY> <a href="white.html"><span class="white">white</span></a><br> <a href="blue.html"><span class="blue">blue</span></a><br> <a href="orange.html"><span class="orange">orange</span></a><br> <a href="green.html"><span class="green">green</span></a><br> <a href="yellow.html"><span class="yellow">yellow</span></a><br> <a href="purple.html"><span class="purple">purple</span></a><br> <a href="brown.html"><span class="brown">brown</span></a><br> <a href="black.html"><span class="black">black</span></a><br> </BODY> </HTML> I want the links to be individual colours, and when hovered over the background goes to that colour and the text changes colour. I have tried everything. ik EDIT I am still slightly stuck with my previous post #16 |
Re: CSS can you suggest?
Well, I haven't seen that square brackets in CSS before. It wasn't the way I was taught anyway. I just subclassed it like so:
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">Edit: An advantage of subclassing it is that it can be reused. you can have multiple whites, blues, reds, etc, regardless of their address. Another edit: Funnily enough post #16 was about subclassing and you didn't know. you can create a default style, and then a subclass of that style which is different. You would do it like this: Code:
Code:
<table>Code:
<tr><td class="heading" colspan=2>Special heading</td></tr> |
Re: CSS can you suggest?
Punky, I have IE 6 and it has the colours for the links but it does not change the background colour for the hover.
also for post 16, I dont want another cell for the heading, this may make my page look awful, look at: http://homepage.ntlworld.com/j.kelly...veanimals.html to see what I mean. thanks for helping dude, I am at a loss ik EDIT I will have more links than the test page, so I was going to leave another formatting for general links. so the [] helps identify the actual link, was suggested earlier in this thread |
Re: CSS can you suggest?
Quote:
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">also for post 16, I dont want another cell for the heading, this may make my page look awful, look at: http://homepage.ntlworld.com/j.kelly...veanimals.html to see what I mean. thanks for helping dude, I am at a loss ik Quote:
|
Re: CSS can you suggest?
Quote:
in my page, it has 3 cells to a row. but I think I could just add another row i will test your new code on IE ik EDIT thats what I was trying to do, now is there away to stop the links from changing colour when they are visited, you know how they become a different colour because it is set to a:visited {color:#FF0000;}? any way that I can force it to remain the same colours as before I clicked? ik |
Re: CSS can you suggest?
Quote:
|
Re: CSS can you suggest?
Quote:
this might be a solution ik |
Re: CSS can you suggest?
Quote:
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
Re: CSS can you suggest?
Punky you are a god..........
I see what you did, you made all three have the same colours, nice one mate, now a killer question, and this whole thing should be over. could I add one of these links to a cell of a table/they all have individual cells? just incase I want to use a table. ik |
Re: CSS can you suggest?
If you're still trying to center a line with SPAN followed by BR, try a DIV instead. Yes, looked at the docs, and a DIV may be contained within a TD.
Applying alignments to spans is ineffective, as the span does not occupy any more space than it's content. SPAN is a generic inline container, often used to replace the deprecated FONT element to apply arbitrary character styles (for consistency in non-CSS browsers, it's better to use a styled text attribute that conveys the appropriate meaning). DIV is a generic block container, without implied margins P is a the Paragraph block container, though often used as a Paragraph break. Styled DIVs can often produce a similar layout to a table, and generally render progressively, where many browsers only render a table after it is complete. |
Re: CSS can you suggest?
cheers matth,
where are the docs? ik |
Re: CSS can you suggest?
http://www.htmlhelp.com/reference/html40/olist.html
I was using the one in 1stPage 2000 - which is a copy of this http://www.htmlhelp.com/distribution/ Also available as a download version - and an excellent reference indeed! http://www.htmlhelp.com/reference/css/ CSS guide too! |
Re: CSS can you suggest?
Quote:
Quote:
I think, if you have CSS that defines the content of a table cell, and you have a link with different CSS, it would still render the link CSS. That is because it intreprets the cell, then intreprets the link, and overwrites any display characteristics that already exist. Is that what you meant? |
Re: CSS can you suggest?
hey guys, still playing away.
I have checked out css zen garden and various links from them & css resouce guide that I got the link form someone above in this thread, which is all good thanks, and they all show the same thing. I am playing with background images within css for web pages. they say this: body{background-image:url("im.jpg"); background-repeat:no-repeat;} some don't some do use " " with the image file, so I take it that this is not essential. the file I am trying to show is in the same folder as the html & css file. I have also tried in the url part of the css: ../im.jpg the full address c:\\................so on, copied from explorer I have even tried to put the image into webspace and use that url, but nothing seems to work for me, it is all ok on other websites, but not the page I am trying to make. what am I doing worng? ik EDIT: sorry guys I seemed to have found my wee prob, I had a comma instead of a full stop in my link rel decleration in the HTML. sorry to have bothered you :dunce: |
| All times are GMT. The time now is 17:39. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
All Posts and Content are © Cable Forum