Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

CSS properties replaced by user agent?

Posted on 2010-08-27
2
Medium Priority
?
1,457 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 84

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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

When applying CSS to your HTML, there are many different ways to select which element(s) the CSS applies to.  Some of these selectors are more commonly known and used than others - Here are the more common ones: #X - Matches an ID of X .X - Matche…
Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
Suggested Courses

688 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