Jump to content
Killersites Community
Sign in to follow this  

Multiple ID's in Div Tag

Recommended Posts

Hi!  First post on this site.  I finished the HTML course and just finished the CSS course a few days ago.  I'm taking a few week off before I start javascript to practice HTML and CSS.  So, here is what I want to know: 

I have an id called #main and an id called #css-table.  

Is there a way to put both of those in one div like <div id="main" "css-table">  or would <div id="main" id="css-table"> work?  I was playing around with both and could not get either one to work. 


Share this post

Link to post
Share on other sites

There are few ways to handle this. First rule, you can't apply two IDs to a tag. IDs have to be unique. 

So I would use one ID to apply all your CSS to the tag in question. Or a class if you plan on using the CSS rules more than once in a page. 

  • Like 1

Share this post

Link to post
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
Sign in to follow this