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 8899731
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T00:55:45+00:00 2026-06-15T00:55:45+00:00

What is the best CSS practice to achieve a border on all sides of

  • 0

What is the best CSS practice to achieve a border on all sides of a container, apart from, for example, the bottom?

The border property cannot specify different values for each side.

Option 1: Overwriting Rules

border: 1px solid red;
border-bottom: none;
  • Seems that an extra computation is needed — similar drawbacks as CSS resets (at least philosophically).

Option 2: Setting Specific Rules

border-top: 1px solid red;
border-left: 1px solid red;
border-right: 1px solid red;
  • Might be more correct (in terms of CSS “semantics”)
  • But if you want to change the border specifics, then it’ll require
    multiple changes (harder to manage).
  • 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-06-15T00:55:46+00:00Added an answer on June 15, 2026 at 12:55 am

    Actually it totally depends on you, what is more convenient to you, it also depends on some state like if I want the color of all borders to be same I’ll go for 1st but If I think I need to change the colors of each side of the border in near future I’ll go with the second 1, but for now, I’ll stick to first option

    Reasons:

    • Less CSS to be stated
    • Specifically it shows that I want border-bottom as none
    • As you said I don’t need to change each and every property: value if I need any changes

    If you say proper semantics, proper semantics define very specifically like

    border-color: /*Whatever*/;
    border-width: /*Whatever*/;
    border-style: /*Whatever*/;
    

    Now am sure you don’t want to be this specific

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

Sidebar

Related Questions

What are the best practices when naming CSS selectors? SomeContainerContent some_container_content some-container-content I read
what is the best way to ensure css/layout code works on all browsers? my
I've learned that it is a best practice to explicitly specify image dimensions. The
What's the best practice for doing a horizontal list in css? Now I know
Having a discussion with a co-worker on what is best practice with CSS clear
What is the best practice to create block hover effects on links using CSS?
While building a Javascript-heavy web application, what is the best practice for naming CSS
In using CSS is it best practice to use a div id only once
What's the best practice to create a checkout (tracking) menu like below in CSS.
Is there a best-practice with knockout.js and/or CSS to prevent the extra divs that

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.