myristate Posted February 25, 2012 Share Posted February 25, 2012 As you can see from the image the sentence is put onto a new line before the word "hard" and after it. This corresponds with the location of the <div> tags. So i am wondering how do i stop it from doing that. I have included the html and css if someone could help please. HTML <div class="raidlist_zonetitle"> Karagga's Palace (8 Man <div class="hard">Hard</div>) </div> <div class="raidlist"> <BR /> Bonethrasher <BR /> Foreman Crusher <BR /> G4-B3 Heavy Fabricator <BR /> Jarg and Sorno <BR /> Karagga the Unyielding <BR /> <BR /> <BR /> </div> CSS .hard { text-align: left; color: #ff6633; font-style: italic; font-size: 1.0em; } Quote Link to comment https://forums.phpfreaks.com/topic/257785-stopping-a-div-from-moving-to-the-next-line/ Share on other sites More sharing options...
gizmola Posted February 25, 2012 Share Posted February 25, 2012 A div is by default a block element. There are ways to override that but in this case, using a span instead of a div is the best solution. Quote Link to comment https://forums.phpfreaks.com/topic/257785-stopping-a-div-from-moving-to-the-next-line/#findComment-1321266 Share on other sites More sharing options...
myristate Posted February 25, 2012 Author Share Posted February 25, 2012 Thanks, that fixed it right up. I was always unsure of the span tag. But ive read up on it now. Thanks! [sOLVED] Quote Link to comment https://forums.phpfreaks.com/topic/257785-stopping-a-div-from-moving-to-the-next-line/#findComment-1321267 Share on other sites More sharing options...
Ivan Ivković Posted March 1, 2012 Share Posted March 1, 2012 To stop a div from moving to bottom, you can use float or display: inline. But span is better in this case. Quote Link to comment https://forums.phpfreaks.com/topic/257785-stopping-a-div-from-moving-to-the-next-line/#findComment-1322817 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.