JamesB Posted November 18, 2014 Share Posted November 18, 2014 Hi How can I have a <button> element next to an <img> element? So on the same line. <div> <button>Register</button> <img src='ajax-loader.gif'></div> I tried float left, display inline block and display inline, none seemed to work. Link to comment Share on other sites More sharing options...
Ingolme Posted November 18, 2014 Share Posted November 18, 2014 Normally they would be on the same line without needing any extra CSS. Is the container too small to fit them both? If the container is shrinking to fit the content (probably because of a float or display: inline-block) then it might be forcing line breaks . In that case, try setting the container's white-space property to nowrap. Link to comment Share on other sites More sharing options...
JamesB Posted November 18, 2014 Author Share Posted November 18, 2014 Ah I had a set width which was too small on the container. Fixed now, Thanks! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now