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

  • Home
  • SEARCH
  • 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 112841
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T02:36:30+00:00 2026-05-11T02:36:30+00:00

I am finding I’m writing a lot of code that looks like this: <div

  • 0

I am finding I’m writing a lot of code that looks like this:

           <div id='leftCol'>                  <div style='padding-top:10px'>                     <asp:Image ID='imgRazor1' ImageUrl='http://www.example.com/dynimg.aspx?imageKey=XXX' runat='server' />                 </div>                     <div style='padding-top:10px'>                     <asp:Image ID='imgRazor2' ImageUrl='http://www.example.com/dynimg.aspx?imageKey=XXX_CART' runat='server' />                 </div>                  <div style='padding-top:20px; padding-bottom:15px'>                     <asp:Image ID='Image3' ImageUrl='~/images/announcements/announcement1.jpg' runat='server' />                     <div style='font-size:x-small'>(from example.com)</div>                 </div>             </div> 

Thats to say I am putting a lot of explicit padding or margins.

I’m wondering what a better approach to this is without ending up with class names like these:

.mediumPadding {     padding-top:10px; }  .smallPadding {     padding-top:5px; }  .padding15 {     padding: 15px } 

When I’m coding actual CONTENT like this as opposed to more generic overall LAYOUT I tend to find that specific padding sizes are more appropriate. I’ll find myself changing from 8px to 11px and then back to 9px. It must be the designer in me, but I dont really like the habit that I’m forming.

I dont see myself being able to revisit a global rule that says ‘medium padding’ is 9px and changing it to 11px and expecting satisfactory results. It may make some pages look nicer and make ruin others.

What do other people do to solve this problem? I want benefits of css, but I need fine control.

  • 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. 2026-05-11T02:36:30+00:00Added an answer on May 11, 2026 at 2:36 am

    Your code suffers from a serious case of div-itis. I would first start by using proper tags for headers, paragraphs, etc. Once you have a properly marked-up document, you can add classes for common elements, then style those classes as necessary. You’ll find that certain types of elements share a style no matter where they are, so you can minimize the amount of inline styling.

    Your classes should reflect an attribute of the element (e.g. ‘caption’). In general, classes should not refer to a specific design implementation. HTML is the ‘what’, CSS is the ‘how’. When you use CSS classes that represent design specifics, you’re injecting the how into your HTML.

    (Yes, sometimes these rules need to be broken. But those are exceptions.)

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

Sidebar

Ask A Question

Stats

  • Questions 59k
  • Answers 59k
  • 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
  • added an answer It may feel different because it is heavily based on… May 11, 2026 at 8:57 am
  • added an answer I think you should be able to use CAST operator… May 11, 2026 at 8:57 am
  • added an answer Maybe you can do something with a [OnDeserializing] event? See… May 11, 2026 at 8:57 am

Related Questions

I am finding I'm writing a lot of code that looks like this: <div
Currently I am designing a website and I am finding it VERY difficult to
My app will be full screen, but I am having trouble finding the document
I am having a very hard time finding a standard pattern / best practice
I am working on a geometry problem that requires finding the intersection of two
I am having a lot of trouble finding good information on how to call
I am using MS AJAX ASP.NET Components (Calendar Extender) and I'm finding this problem.
I am working on localization for a asp.net application that consists of several projects.
I am looking for good methods of manipulating HTML in PHP. For example, the
I am aware that in .NET there are three timer types (see Comparing the

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.