Solved

CSS properties replaced by user agent?

Posted on 2010-08-27
2
1,455 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
[X]
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
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

CSS3 Custom checkboxes This article shows how to style the checkbox form element using only CSS. Works in: Chrome, FF, Safari, Opera, IE9+ Uses modernizr.js to check for :checked pseudo class, falling back to plain old checkboxes (IE8 and bel…
CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
In this tutorial viewers will learn how to define a gradient in CSS. Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Gradient. Define the background as "linear-gradient(to right, #ee3668, black)". Ensure you …
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
Suggested Courses

623 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