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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T01:33:21+00:00 2026-05-20T01:33:21+00:00

In relation to my previous question here . If I am using the below

  • 0

In relation to my previous question here.
If I am using the below HTML code as part of my web page, where there will likely be many more div tags, how can I target these particular divs in my CSS ? The sample I think works best is [This Answer][2].

I added Id attributes to make the divs more selectable in a large HTML DOM… I don’t know how else to make them more distinguishable. If there is a better method for doing so please let me know. The goal is to apply the CSS design to about 6 div tag elements inside a large share point portal website. If there is a more generic way that would be cool so I can easily add more sections and use this format in the future… I can add a class attribute to each element I want the formatting applied to, but I don’t know the syntax.

What’s the designer professional web way of getting this done?

<div id="projectName">
       Realtime Account Activiation
</div>

<div id="divAnnounce">
        Announcements
</div>

I have
http://jsfiddle.net/eW532/1/

I am using the code below but getting bad results where the entire horizontal length is blue but not the first letter. I’m trying to have an html element use two classes together.

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">
        .even_spacing {  color: purple;
                        background-color: #d8da3d }

        .first_letter {  background:blue;
                        color:white;
                        padding:4px 0px 4px 5px;}           
  </style>

</head>
<body>
    <form id="form1" runat="server">

    <div class="first_letter even_spacing">
        Realtime Account Activiation
    </div>

    <div class="first_letter even_spacing">
        Announcements
    </div>
    </form>
</body>
</html>
  • 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-20T01:33:22+00:00Added an answer on May 20, 2026 at 1:33 am

    in the HTML file put
    <LINK REL=StyleSheet HREF="Path/to/your/stylesheet.css" TYPE="text/css" MEDIA=screen> at the top of the page to reference the new style sheet.

    in your CSS File put:

    #projectName{
    style:value;
    }
    
    #divAnnounce{
    
    }
    

    The # targets things with ID’s if you use a . before it will target the class names,

    You can also use both if you need to get specific such as

    #idname.classname{
    
    }
    

    If you have another div inside of the divAnnounce you can do

    #divAnnounce #yournewdiv{
    
    }
    

    OR

    #divAnnounce div{
    
    }
    

    OR

    #newdivid{
    
    }
    

    Notice the space inbetween the two targets saying that they are a parent and child

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

Sidebar

Related Questions

No related questions found

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.