Jump to content

Recommended Posts

Posted

Following code makes a hr line as we know but is there a way to make it thinner? As it is now its twice the thick as i want.

 

><HR COLOR="#FFFFFF" WIDTH="75%">

 

-Thomas

Posted (edited)

First of all, don't use caps for HTML tags, especially if you're coding XHTML, since it's invalid code.

 

And remember to close your tags. In XHTML you *must* close all the tags. Those that didn't have a closing tag in HTML, like <img> and <hr>, should be written like <img /> and <hr />.

 

And I also suggest that you use CSS instead of the old HTML attributes, since all "presentation attributes" of the hr element were deprecated in HTML 4.01.

 

So... you can do it like this:

><hr style="color: #fff; width: 75%; height: 1px;" />

but even with 1px height it still shows like 2px, because it has the top and bottom lines. Try setting it to 10px to see what I mean.

 

By the way, the #fff is equivalent to #ffffff. CSS allows you to pack the colors definitions. A better example would be this: #5b2 = #55bb22.

 

At last, the solution I *don't* recommend: use the "size" attribute, like this:

><hr color="#FFFFFF" width="75%" size="1" />

but remember, this has been deprecated in HTML 4.01 and is not supported in XHTML - I tried using it on a page with the DOCTYPE set to XHTML 1.0, both Transitional and Strict, and the bar didn't show in any of them.

Edited by TCH-Raul
Posted

Thanks Raul. :)

Not sure though if CSS works in CSB but I give it a try.

Also thanks for the extra info:

By the way, the #fff is equivalent to #ffffff. CSS allows you to pack the colors definitions. A better example would be this: #5b2 = #55bb22.

I always wondered why its only 3 letters in css fonts-color. Now I know. :dance:

 

-Thomas

Posted

No problem, I always like to help :)

 

As for CSB working with CSS: I don't know since I never used it but it should allow you to edit the code manually, in which case you can do it easily :dance:

Posted
As for CSB working with CSS

It works very well. At least this thing did.

When inserting code directly in to csb (not using holders), we need to use to surround it, so it was mostly how it would react on that that i was worried of but it worked. :)

 

-Thomas

Posted

True about hr line... don't use it. I always recommend a graphic instead (i.e. a small gif file).

Posted

No SEO motive here just a browser support issue (e.g. the color attribute). I think a simple .gif line (universal support :) ) with a defined 'look' is better visually.

Posted (edited)
Ah. I see. Different browsers.

 

 

And I see dead people.

 

Stupid question, what's an hr line? That where you stand at the end of the week to get your paycheck?

 

Edit: Duh, never mind. Horizontal line. Gee Rob, next time just open notepad and see for yourself.

 

I am going back to packing now. :::::walking away in shame::::

Edited by TCH-Rob
Posted

lol @ Rob :P

:)

 

Scott, I did think you had some SEO motives for not recommending the use of HR ;)

So what you're saying is that not every browser supports the same attributes for the HR tag? Even with CSS?

Posted

The basic tag for a horizontal rule, <HR> is still valid in HTML, but all its attributes were deprecated in HTML 4.0 (marked for future deletion).

 

You are correct Raul (no surprise :) ), you can use the background attribute in CSS and it will work in Explorer 5.x and 6.x, and Netscape 6.x browsers.

 

Ex.

 

HR {

height:1px;

width:50%;

background:#000066;

margin: 0px 150px 0px 150px;

}

 

I still prefer a simple gif file though ;)

Posted

OK, I was starting to find it weird. I didn't had the time to check it but I was almost sure that you could style an <hr> line with CSS. Unless it was something that only worked on some browsers. I wasn't sure and didn't check it, hence my question. I don't use <hr> much, anyway, so... who cares? :)

Posted

The "make the hr line as a picture" idea wasnt bad.

The program I use to make websites in doesnt like colored lines, so this one made it look much better in every way.

Thanks everyone involved.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...