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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T23:13:02+00:00 2026-06-16T23:13:02+00:00

For a given class, I want to have the following styles: stlye1 { padding-top:

  • 0

For a given class, I want to have the following styles:

stlye1 {
    padding-top: 0;
    padding-right: 0;
    padding-bottom: 10px;
    padding-left: 0px;
}

But that’s a lot of duplicates so I would like to just write:

stlye1 {
    padding: 0;
    padding-bottom: 10px;
}

Will this be something bad to do?

update:

when I see 3 values (the short hand), i’m not sure what is the last one going to apply to.
so i came up with the second method above to make it clear which one i want to override.

update 2:

for a short hand method, how do you specific the followings:

stlye1 {
    padding-top: 0;
    padding-right: 0;
    padding-bottom: 10px;
    padding-left: 0px;
}

style1 {
    padding: 0 0 10px; // now i know this one, thanks!
}



stlye2 {
    padding-top: 0;
    padding-right: 10px;
    padding-bottom: 0;
    padding-left: 0px;
}

style2 {
    padding: 0 10px 0; // is this correct?
}



stlye3 {
    padding-top: 10px;
    padding-right: 0;
    padding-bottom: 0;
    padding-left: 0px;
}

style3 {
    padding: 10px 0 0; // is this correct?
}



stlye4 {
    padding-top: 0;
    padding-right: 0;
    padding-bottom: 0;
    padding-left: 10px;
}

style4 {
    padding: // i have no clue.
}

update 3:

in short, style2 and 4 cannot be done in shorthand format by suppling 3 values only.
as indicated by PassKit, left and right can’t be specified alone with 3 values only.

  • 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-16T23:13:03+00:00Added an answer on June 16, 2026 at 11:13 pm

    While your suggestion is perfectly valid, the most concise form would be:

    stlye1 {
        padding: 0 0 10px;
    }
    

    This short hand format breaks down as padding: top(0) right(0) bottom(10px); and left defaults to the right value because a left value has not been specified.

    For the 4 styles in your question, styles 1 and 3 are correct, but for styles 2 and 4, see style 5 below and the accompanying note.

    For reference, the style shorthand breaks down as follows:

    If there is one value, it applies to all 4 attributes, top, right, bottom and left.

    stlye1value {
        padding: 10px;
    }
    
    /* equals */
    
    stlye1value {
        padding-top: 10px;
        padding-bottom: 10px;
        padding-left: 10px;
        padding-right: 10px;
    }
    

    If there are two values, the first value applies to top & bottom attributes and the second value to left & right

    stlye2values {
        padding: 0 10px;
    }
    
    /* equals */
    
    stlye2values {
        padding-top: 0;
        padding-right: 10px;
        padding-bottom: 0;
        padding-left: 10px;
    }
    

    If there are 3 valus, the first applies to top, the second applies to left & right and the third applies to bottom.

    stlye3values {
        padding: 0 10px 20px;
    }
    
    /* equals */
    
    stlye3values {
        padding-top: 0;
        padding-right: 10px;
        padding-bottom: 20px;
        padding-left: 10px;
    }
    

    Specifying all 4 values sets padding in the order top, right, bottom, left (think of a clockwise circle starting at the top).

    stlye4values {
        padding: 0 10px 20px 30px;
    }
    
    /* equals */
    
    stlye4values {
        padding-top: 0;
        padding-right: 10px; 
        padding-bottom: 20px;
        padding-left: 30px;
    
    }
    

    Note: There is no way to independently specify a right or left value using shorthand without entering all 4 values or using the padding-left or padding-right.

    style5 {
        padding-left: 10px; 
    }
    
    /* providing there are no previous padding rule for style5 equals */
    
    style5 {
        padding: 0 0 0 10px; 
    }
    
    /* equals */
    
    stlye5 {
        padding:0;
        padding-left:10px;
    }
    
    /* equals */
    
    stlye5 {
        padding-top: 0;
        padding-right: 0; 
        padding-bottom: 0;
        padding-left: 10px;
    
    }    
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a class C(Of T). I want to determine if some given value
I want to override the tree_id field as following: Given: class Thing(MPTTModel): thing_id =
Given the following model, I want to index the fields (sequence,stock) class QuoteModel(models.Model): quotedate
given this class definition: public class Frame { IFrameStream CapturedFrom; } I want implement
Given a simple parent/child class structure. I want to use linqkit to apply a
I want to know the name of a given object in a class class
i have been given class with int variables x and y in private, and
Hi I have the following table of data Class | Member | Value ----------------------
I want to check if a given Class is assignable to a java.util.Collection, and
Given is the following example: class Foo(object): def __init__(self, value=0): self.value=value def __int__(self): return

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.