Solved

CSS properties replaced by user agent?

Posted on 2010-08-27
2
1,437 Views
Last Modified: 2012-05-10
Using a <hr class="myclass" /> in my html works in Firefox. But in Safari and Chrome it is not displaying the <hr> in the correct style.

Using the developer tools in Safari and Chrome it shows that my <hr> styles are overridden by the User Agent Stylesheet. Does anyone know how to prevent this?
0
Comment
Question by:garysamuels
2 Comments
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 33545089
Are other things not working also?  Do you have an "@charset" in the first line of your CSS file?  If so, remove it.  Safari doesn't seem to like that and Chrome is a 'Webkit' browser also so it often acts just Safari in these things.
0
 

Accepted Solution

by:
garysamuels earned 0 total points
ID: 33558494
I was trying to offset the <hr> using padding or margins. Chrome and Safari didn't like it so they ignored the style. I removed the padding or margins, set the style to: float:right width:90% and it worked in all the browsers.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now