Jump to content

Recommended Posts

Posted

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. 

Thanks. 

Posted

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

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...