|
Posted by Chuck Anderson on 08/19/06 21:43
lawrence.hunt@gmail.com wrote:
> 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
>
>
This has nothing to do with using Php, you simply need semi-colons after
each style element.
i.e., ...
#storyform {
position: absolute;
top: 200px;
left:300px;
width:724px;
height: 500px;
}
#commentform {
position: absolute;
top: 200px;
left:300px;
width:724px;
height: 500px;
}
--
*****************************
Chuck Anderson • Boulder, CO
http://www.CycleTourist.com
Everyone's journey should be different,
so that we all are enriched
in new and endless ways
*****************************
Navigation:
[Reply to this message]
|