Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

CSS

 
shaf maff
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys

How can I manage CSS in JSP pages using the struts tag lib. Everytime I code a page and run it in browser all the html is at the top and all the tags are at the bottom. Its like I cannot mix the two. Why is this ?
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You'll have to be more specific. CSS doesn't really have anything to do with Struts, so you'll need to explain (a) what you're trying to do, (b) how you're doing it, and (c) how the results vary from your expectations.

http://faq.javaranch.com/java/TellTheDetails

It saves everybody time.
 
shaf maff
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok - Here is the code:



As you can see, there is a tag above the "Contact Details" header and one below it. When I run it in the browser it should output as follows:



But instead the browser displays it as follows:




.
[ December 21, 2008: Message edited by: shaf maff ]
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure what this has to do with CSS at all.

Are you using the "simple" theme or the default "xhtml" theme? I'm guessing "xhtml" theme. Have you examined the rendered HTML? That will provide you with a hint as to what's gone wrong.
 
shaf maff
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well since it was to do with the layout I assumed it was a css issue because the html was fine. I will play around with the themes and see if that works.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It'd have been quicker to tell me which theme you were using.

The "xhtml" theme renders form elements inside tables. If you're using the "xhtml" theme the snippet you posted would be invalid HTML, and different browsers would treat the invalid HTML in different ways.

I don't know if I believe you when you say that "the HTML was fine", because you didn't post the rendered HTML--considering how easy it is to cut-and-paste it'd be just as easy to cut-and-paste what's actually being emitted than to type something in that isn't complete.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic