Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

CSS properties replaced by user agent?

Posted on 2010-08-27
2
1,450 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:Gary Samuels
2 Comments
 
LVL 83

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:
Gary Samuels 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at google.com/fonts: Browse or search based on font properties or name to find a suitable font for…

856 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