Posted by lawrence.hunt on 08/19/06 20:17
I cant seem to get CSS to work with my PHP code. An example is this:
<?php if (isset($_GET['addstory'])): // If the user wants to add a
story
?>
<div id="storyform">
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<label>Type your story here:<br />
<textarea name="storytext" rows="10" cols="40">
</textarea></label><br />
<input type="submit" value="SUBMIT" />
</form>
</div>
<?php elseif (isset($_GET['addcomment'])): // If the user wants to add
a comment
?>
<div id="commentform">
<form action="<?php echo $_SERVER['PHP_SELF'].'?comment='.
($_GET['addcomment']); ?>" method="post">
<label>Type your comment here:<br />
<textarea name="commenttext" rows="10" cols="40">
</textarea></label><br />
<input type="submit" value="SUBMIT" />
</form>
</div>
The CSS for this is:
#storyform {
position: absolute
top: 200px
left:300px
width:724px
height: 500px
}
#commentform {
position: absolute
top: 200px
left:300px
width:724px
height: 500px
}
Nice and basic but should it not move the forms somewhere in the middle
of the screen. Currently they are still positioned as if there was no
styling :S
I have added other div tags outside of the php i.e. for a navbar
etc.and they work fine.
Any help would be much appreciated :D
Thanks
[Back to original message]
|