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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T11:26:24+00:00 2026-05-15T11:26:24+00:00

If I had 5 divs with ids element1, element2, etc…, is there a way

  • 0

If I had 5 divs with ids “element1”, “element2”, etc…, is there a way to style an array of elements with something like:

#elements[1-10]{
 position:relative;
}

I know you guys probably think I’m nuts, but I’m dealing with some code that is auto generated and I would have to edit the core files of this cms which I don’t want to do in case client upgrades in future.

With that said, it is out of the question for me to change the IDs manually to a class.

  • 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-15T11:26:25+00:00Added an answer on May 15, 2026 at 11:26 am

    This works in many modern browsers… except IE:

    <style type="text/css">
      p[id*=elements] {
        color: #F00;
      }
    </style>
    

    HTML

    <p id="elements1">Elements 1</p>
    <p id="elements2">Elements 2</p>
    <p id="elements3">Elements 3</p>
    <p id="elements4">Elements 4</p>
    <p id="elements5">Elements 5</p>
    

    But there’s – of what I know – no way of limiting it.

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

Sidebar

Related Questions

If I had a bunch of absolute positioned divs and they overlapped, how would
DIVs or TABLEs? Here's a question for front-end developers out there. Are table-less designs
I'd like to adjust the margin of container divs and the padding for links
If I had two divs, both with id="myDiv", would $("#myDiv").fadeOut(); fade both divs out?
I've never had a problem with aligning divs side by side but for some
I have multiple divs like setted up below. I want 1 (one) JQuery function
I had a problem today. I had 3 divs with variable heights, I never
I want to create large button style divs in the centre of the page
I have a bunch of elements (divs) and they represent items. I can delete
Never had problems with centering divs before but I have been trying to get

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.