File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes display needed in same line. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "display needed in same line." Watch "display needed in same line." New topic

display needed in same line.

thejwal pavithran
Ranch Hand

Joined: Feb 11, 2012
Posts: 119

hey guys i want the map and the form in the code above to be displayed on the same line. here its getting displayed one below the other.

what can i do please help.

on job hunt
Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
You need to either float your elements or make them inline-block.

Anki Jain

Joined: Dec 28, 2012
Posts: 5
you have given fixed width in div id as block 1 remove it and use float: left in css
and your code will be as follows:
following changes are in

remove div's width.
<div id="blcok1">

give style to i frame and set is as float:left
<iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0"
Maharashtra&t=m&ll=18.4468,73.813486&spn=0.161987,0.095167&output=embed" style="float:left;">

and in form also give it style and set it as a float:left
<form method = "post" action = "ContactServlet" style="float:left;">

for more here.
I agree. Here's the link:
subject: display needed in same line.
It's not a secret anymore!