Jump to content
Stef's Coding Community
Sign in to follow this  
danhodge

two div tags on one line?

Recommended Posts

My current project is on this link here, which is just for me to test Javascripts and some CSS i don't know yet.

 

I am hoping to make one button a lighter blue, and the others stay the color they are now.

 

I tried this by using two Div tags, but i can't seem to keep them on the same line if i do use the two div tags...

 

 

Is there a way around this, like a Javascript event that handles a link that has been clicked on, and can change the background?

 

 

Thanks,

Danny

Share this post


Link to post
Share on other sites

I can't see your website at the moment, the page is from your web host and says "You are seeing this page because the system administrator of 000webhost.com is currently checking this website for malicious content. This redirect page will be removed once we finish manually checking all files on this account."

 

To answer your query in general terms, to get divs side by side all of them must have float: left; or float: right.

 

It's often a good idea to put all the floated divs in a container which has overflow: hidden; or another method to clear the floats to stop lower content moving up into any available space below a floated div that has less content than others. It keeps lower content below the lowest floated div. There are other ways to do this.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...