Jump to content

dynamic IDs Solved with thanks in the final post.


niche

Recommended Posts

What's the notation for the CSS for all the IDs the begin with: itemInfo? #itemInfo???? Can it work that way?

Edited by niche
Link to comment
Share on other sites

That's how this page shows it. Technically, though, the ID selector is #. What CodeName is showing you is an attribute selector. The attribute in this case happens to be the ID.
In addition, An ID selector, targets just the ID attribute, while attributes selector, targets any specified attribute. Edited by CodeName
Link to comment
Share on other sites

I may not be following you. Are you saying is how to define the style for all IDs beginning with: itemInfo?

<style type="text/css">[id^=itemInfo] {   position:absolute;   background-color: yellow;    width: 300px;    height: 50px;    margin: 0px 0px 0px 105px;}</style>

Link to comment
Share on other sites

Yes. Thanks. How did you know where to use that ref that way?

Edited by niche
Link to comment
Share on other sites

It worked. I forgot to change the id reference in the JS. Thanks to CodeName and ShadowMage for their help.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...