Re: [css-d] CSS statements for horizontal rule
I've used CSS to style s for a long time. Here's an example from one of my sites div#menu hr { width: 95%; height: 1px; border: 0; clear: both; /* puts the hr below floated content */ margin: 0.625em auto; /* side margins set to auto centers the hr */ color: #ddd; /* set color in IE */ background-color: #ddd; /* set color in FF */ } You could add "float: right" or "float: left" to get right or left alignment. Or "position: absolute;" and "left: xxx" to position it in an exact place. The thing to remember when styling is that it is a block level element. This means it acts like a div or a paragraph by default. "Text-align: left" will align whatever text is in the left. But since it's an , it has no text. ---Tim __ css-discuss [cs...@lists.css-discuss.org] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] CSS statements for horizontal rule
--- On Tue, 5/19/09, Bobby Jack wrote: > ... > in your CSS and: > > > > ... Sorry, Alan's point about closing the element is obviously an important one; I rarely work with XHTML nowadays! - Bobby __ css-discuss [cs...@lists.css-discuss.org] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] CSS statements for horizontal rule
> I am trying to use horizontal rules > of specific width and position in an > xhtml strict 1.0 web page. The width and align > attributes work, but do not > pass the strict 1.0 validation test (as you probably > know). > > I have tried using both class and id statements in a CSS > file (with > appropriate selectors in the body). Neither > work. Hi Mike, It should be perfectly possible to achieve what you want, with the method you're using. Something like: .test { width: 400px; } in your CSS and: will validate and have the expected result. That's 'width', anyway. I'm not quite sure what you mean by 'position' - maybe you could elaborate. If this is similar to what you're doing, and it's still not working, a specific example (preferably by URL) would help us to solve the problem. Regards, - Bobby __ css-discuss [cs...@lists.css-discuss.org] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] CSS statements for horizontal rule
Mike Morris wrote: > I am trying to use horizontal rules of specific width and position in an > xhtml strict 1.0 web page. The width and align attributes work, but do not > pass the strict 1.0 validation test (as you probably know). When validating the element with XHTML 1.0 Strict, you must code it this way. As per the grammer of XHTML for empty elements. > I have tried using both class and id statements in a CSS file (with > appropriate selectors in the body). Neither work. I have performed > extensive searches on the internet (including the archives of this list), > but I have found no information on how to accomplish the desired task. May I inquire what is the desired task? Do you have a test page? > Is it not possible to set these hr parameters under strict 1.0 (and have > them pass the validation test)? If not, is there an alternative? > > I need to say that I have only a beginner's knowledge of CSS. > > Thank you for your help. BTW, there are a few bugs with styled with text-align in IE8. Welcome to the world of CSS (but don't forget to improve the HTML) and welcome to this list. -- Alan http://css-class.com/ Armies Cannot Stop An Idea Whose Time Has Come. - Victor Hugo __ css-discuss [cs...@lists.css-discuss.org] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/