Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 192689
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T16:26:48+00:00 2026-05-11T16:26:48+00:00

Sadly, CSS outline isn’t supported in IE7, so i’m stuck using border. But adding

  • 0

Sadly, CSS outline isn’t supported in IE7, so i’m stuck using border. But adding a border to any element on the page takes up room and possibly shifts the page.

If i’m adding a 2px border, then I set a -2px margin, it sill isn’t perfect, as list items move to the left, and “margin:auto” really screws with it.

You can see examples here:

http://paul.slowgeek.com/nodeSelector/tests/simple.html

http://paul.slowgeek.com/nodeSelector/tests/center1.html

For example, if a page had :

<div>
    <p>Lorem Ipsum</p>
</div>

And then I did :

<div>
    <p style="border: 5px solid red">Lorem Ipsum</p>
</div>

The page would now be 10 px bigger and the p element would be 5 pixels indented. But if i did :

<div>
    <p style="outline: 5px solid red">Lorem Ipsum</p>
</div>

in firefox 3, the page would be the exact same height and the element would be in the same position. I want this behavior to work cross browser.

Basically, how can you use a CSS border to get the effect of a CSS outline?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T16:26:49+00:00Added an answer on May 11, 2026 at 4:26 pm

    If it’s hover effects you’re worried about, and your background is of uniform colour then simply set the non-hover border ot the elements to the background colour, and then just change the colour on hover. So the element is always the same size, though you will have to decrease the padding to adjust for the border always being there.

    so
    instead of

    a p {padding: 10px;}
    a:hover {border: 5px solid red;}
    

    use

    a p {border: 5px solid white;padding:5px}
    a:hover p {border-color: red;}
    

    As an aside, if you’re using :hover on any element other than a link or an input then no effect will be seen in ie6, which a lot of people still use. But you can use the ie7 script to fix that: http://code.google.com/p/ie7-js/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 123k
  • Answers 123k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer VerifyGet is enough, assert seems to add no value so… May 12, 2026 at 1:03 am
  • Editorial Team
    Editorial Team added an answer Your code looks right (I haven't tested it), and the… May 12, 2026 at 1:03 am
  • Editorial Team
    Editorial Team added an answer Command-line scripting can be very useful, even in the Windows… May 12, 2026 at 1:03 am

Related Questions

Sadly, CSS outline isn't supported in IE7, so i'm stuck using border. But adding
I've accepted an answer, but sadly, I believe we're stuck with our original worst
This is driving me mad... I was doing my asp.net sandbox website when out
Hey. We're building a large ASP.NET website, and have hired an external firm to
I've got a layout bug that shows up in IE6, and I'm trying to

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.