1
$<input id="" name="" value="V" type="radio"><img id="" src=".../image.gif" alt="" border="0"><input id="" name="" value="V" type="radio"><img id="" src=".../image.gif" alt="" border="0"><input id="" name="" value="V" type="radio"><img id="" src=".../image.gif" alt="" border="0">
$<div class="wrapper">

As you see here i have like 3 lines or more in a php file and when i open it with any browser it shows me 2 on the same line and the last one under'em so how to keep these three pics on the same line .. is this have a relation with the page size ? if bigger it will show them on the same line ? is this true ?

Thanks for reply :)

chicho
  • 11
  • 1
  • 2

2 Answers2

0

Apologies in advance if I'm misinterpreting what you're asking, but if you want to display the three images in one line, you can use CSS. In each of your image tags, you can add inline styling by adding the "style" attribute:

<img id="" src=".../image.gif" alt="" style="display: inline; border-width: 0px;" />
Ron
  • 176
  • 1
  • 10
  • actually they are in the same line but the page width is little small so automaticly it returns to the other line so how can i modify the page size.. – chicho Aug 14 '12 at 09:32
  • If you're referring to the size of the window, I am going to advise that doing so is somewhat bad practice. However, as long as you're not using Chrome, it [looks like it can be done with some JavaScript](http://stackoverflow.com/questions/5238603/javascript-set-browser-window-size). Otherwise, your images and radio buttons are just too wide to fit on the page. You will either have to scale them down or increase the width of any containers/wrappers you have elsewhere in your code. The div with class "wrapper" isn't what you're looking for though, as it's below your other lines of code. – Ron Aug 14 '12 at 11:20
0

If you have text-level (inline) content like input elements, img elements, and text in HTML source, they will appear in the same line if the available width permits that and there is nothing that causes a line break (such as <br>).

For usability and accessibility, there should normally be one input item (an input element and associated label) on one line. This is best achieved using HTML tags that cause such rendering, such as wrapping the item in a div element.

But if you wish to put the content on one line, you can wrap it all inside a div element and set white-space: nowrap on it in CSS (or, somewhat more effectively, wrap it all inside the nonstandard but well-supported nobr element). This may then force horizontal scrollbars, if the content does not fit into the available width.

Jukka K. Korpela
  • 195,524
  • 37
  • 270
  • 390