aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Two divs side by side using jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Two divs side by side using jsp" Watch "Two divs side by side using jsp" New topic
Author

Two divs side by side using jsp

satyaprasad veeramsetti
Greenhorn

Joined: Dec 21, 2012
Posts: 28
Dear all,

I am facing one problem with divs in jsp file. I have included the below code in html.


<div style="float: left">Satyaprasad</div><div style="border-bottom: 2px dotted #000000"></div>




Actually my required output is as shown below.


Satyaprasad.............................................................................................





But i am getting the output as shown below.

..................................................................................................................

Satyaprasad



Please help me, is there any mistake in my code.


Thanks inadvance.

-Satyaprasad
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Basic idea:

HTML:



CSS:



Example: http://jsfiddle.net/7YbR8/


Other choice, use inline elements.
Rob Crowther
author
Ranch Hand

Joined: Nov 06, 2012
Posts: 297
    
    5

You could also use display: table.


Read my books: Hello! HTML5 & CSS3 | HTML5 in Action | Read my blog
 
 
subject: Two divs side by side using jsp