13-02-2005, 16:14
|
#1
|
|
Inactive
Join Date: Mar 2004
Location: Glasgow, Scotland
Services: anything for a new job
Posts: 4,165
|
CSS can you suggest?
hey everyone,
I am currently trying to re write my site, using CSS, and I have been looking for the CSS equivelent of the horizontal rule <HR>
can anyone tell me how to do this ins css, I am looking for 5px high, and width of 85%
I tried this but to no avail:
hr {text-align:center width:85pc height:5px}
text-align is the only align I can find, align itself does not work
I thought pc is for percent
height i thnik I have right.
what am I doing wrong?
my html looks like this:
<hr></hr>
also can you design tables in css?
ik
|
|
|
13-02-2005, 16:43
|
#2
|
|
Inactive
Join Date: Jun 2003
Age: 45
Posts: 14,750
|
Re: CSS can you suggest?
Ok, a few points:
1. HR doesn't need a closing tag, so only <hr> is needed
2. They auto centre align (or should do.)
I have just written this and tested it in FireFox and IE and it works
CSS:
Code:
hr {
width:55%;
height:5px;
}
HTML:
Second point, you can use CSS in tables. Just use the table element tags (table, tr, td), like the HR one above, like:
or combining multiple:
Code:
table, td, tr {
...
}
HTH mate.
|
|
|
13-02-2005, 17:01
|
#3
|
|
Inactive
Join Date: Jun 2003
Location: Los Angeles, CA
Age: 47
Posts: 6,343
|
Re: CSS can you suggest?
If you're using XHTML then use <hr />, also to colour the HR then use this CSS:
Code:
background-color: #248; /* Netscape 6/7, Mozilla */
color: #248; /* IE */
border: #248; /* Opera */
|
|
|
13-02-2005, 17:21
|
#4
|
|
Inactive
Join Date: Mar 2004
Location: Glasgow, Scotland
Services: anything for a new job
Posts: 4,165
|
Re: CSS can you suggest?
thanks for the replies, but I am not using XHTML.
ik
|
|
|
13-02-2005, 21:23
|
#5
|
|
Inactive
Join Date: Mar 2004
Services: BB:M, TV:XL, Phone:M, Loyalty
Posts: 2,516
|
Re: CSS can you suggest?
Punky's code works in my ediitor preview
also HR STYLE="width: ..... and so on, but you want it as a sheet, presumably, and not per use.
You can also use HR CLASS=, to be able to specify a number of differently styled HR elements. Actually, you can use ID= as well, but indidually enumerating them is unlikely to be of much use.
|
|
|
14-02-2005, 08:34
|
#6
|
|
Inactive
Join Date: Mar 2004
Location: Glasgow, Scotland
Services: anything for a new job
Posts: 4,165
|
Re: CSS can you suggest?
Quote:
|
Originally Posted by Matth
Punky's code works in my ediitor preview
also HR STYLE="width: ..... and so on, but you want it as a sheet, presumably, and not per use.
You can also use HR CLASS=, to be able to specify a number of differently styled HR elements. Actually, you can use ID= as well, but indidually enumerating them is unlikely to be of much use.
|
thanks,
I did not need to use an ID or a class, I just used the CSS to target the HR, becuase the pages that the HR is on, there is only one, so I don't need the hr to be different from anything else.
I have finished half of my site, which a lot of code is now gone to CSS, and they load better and look just the same, but essentially they are all the same on:
Firefox
IE
Netscape 7.2
Opera 8 beta
I will need to look into coding for audible browsers, to make the site more accessible friendly.
ik
|
|
|
14-02-2005, 08:59
|
#7
|
|
Inactive
Join Date: Jun 2003
Age: 45
Posts: 14,750
|
Re: CSS can you suggest?
Quote:
|
Originally Posted by ikthius
I will need to look into coding for audible browsers, to make the site more accessible friendly.
|
Yeah, that is a legal requirement now these days
|
|
|
14-02-2005, 12:27
|
#8
|
|
Inactive
Join Date: Mar 2004
Location: Glasgow, Scotland
Services: anything for a new job
Posts: 4,165
|
Re: CSS can you suggest?
another wee thing, I have topstyle to help me with some code, but I can't for the life of me find what I am looking for
pic 1 is done on html and pic 2 is using css, how can I get the table bang in centre of screen and how can I get the table borders to show?
I tried border:2px; border-style:groove;
but this just gave a border, but no internal lines.
ik
|
|
|
14-02-2005, 13:25
|
#9
|
|
Inactive
Join Date: Jun 2003
Location: Los Angeles, CA
Age: 47
Posts: 6,343
|
Re: CSS can you suggest?
td {
border: 2px #aaa groove;
}
Replace #aaa with whichever colour.
|
|
|
14-02-2005, 13:54
|
#10
|
|
Inactive
Join Date: Mar 2004
Location: Glasgow, Scotland
Services: anything for a new job
Posts: 4,165
|
Re: CSS can you suggest?
thanks richard,
but how do I get it in the centre?in my body I have text-align:center, but I guess this is just for text, how do I do it with a table
ik
|
|
|
14-02-2005, 15:14
|
#11
|
|
Inactive
Join Date: Jun 2003
Location: Los Angeles, CA
Age: 47
Posts: 6,343
|
Re: CSS can you suggest?
table {
width: 90% /* example */
margin-left: auto;
margin-right: auto;
}
|
|
|
14-02-2005, 15:22
|
#12
|
|
Inactive
Join Date: Mar 2004
Location: Glasgow, Scotland
Services: anything for a new job
Posts: 4,165
|
Re: CSS can you suggest?
cheers mate, I was playing about with everything but the 2 of them together, sometimes you just need to be pushed in the right direction.
reps to you mate.
ik
|
|
|
14-02-2005, 18:49
|
#13
|
|
Inactive
Join Date: Mar 2004
Services: BB:M, TV:XL, Phone:M, Loyalty
Posts: 2,516
|
Re: CSS can you suggest?
|
|
|
14-02-2005, 19:04
|
#14
|
|
Inactive
Join Date: Jun 2003
Age: 45
Posts: 14,750
|
Re: CSS can you suggest?
I don't know if you use Firefox, but there are a couple of awesome plugins which make developing web pages a lot less hassle.
Web Developer 0.8
EditCSS 0.2.3
|
|
|
14-02-2005, 20:56
|
#15
|
|
Inactive
Join Date: Mar 2004
Location: Glasgow, Scotland
Services: anything for a new job
Posts: 4,165
|
Re: CSS can you suggest?
cheers punky
I do infact use firefox, and I have the web developer, but I forgot about using it, but not heard of the editcss, so I have downloaded it
reps to you.
ik
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT. The time now is 20:11.
|