TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   XHTML, HTML, CSS (http://www.talkphp.com/xhtml-html-css/)
-   -   Common issue? (http://www.talkphp.com/xhtml-html-css/2037-common-issue.html)

ReSpawN 01-21-2008 01:39 PM

Common issue?
 
Hey guys,

I've been trying to get my bearings since I kinda dropped CSS for PHP. I want to make a 400x100 div layer in a document and centering it both horizontally and vertically. Yet I have NO idea how to manage this.

Anyone crazy enough to take a guess? :-P

Thanks.

sketchMedia 01-21-2008 02:15 PM

by using css, php wont position things for you, unless you tell it to output html with some css, but then you are mixing presentation logic and php logic.

this may be of some use: Joe2Torials.com * ‡ * css - Horizontal And Vertical Centering

ReSpawN 01-21-2008 02:33 PM

I know that you can't position anything with PHP. :-) It's a scriptlanguage not meant for markup.

Thanks. ;-)

sketchMedia 01-21-2008 02:35 PM

hehe :-D just thought i'd make sure.
hope that article helps

ReSpawN 01-21-2008 03:46 PM

Sure did sketch, thanks aloot. ;-)

Orc 01-21-2008 04:55 PM

Just put <style></style> tag's before <?php ;-D and add the CSS you want :P and then you can wrap a Div around the '<?php ?>' and it should do the trick. Like almost everyone else said, you cannot do it in php thus do it outside the tags.

ReSpawN 01-21-2008 04:56 PM

Making<style> tags on every page makes the page load time only longer... Simply create a <link> with the stylesheet type. :-) And of course you can simply use <span style="font-weight: bold;"> but that aside.

Orc 01-21-2008 05:06 PM

Quote:

Originally Posted by ReSpawN (Post 9161)
Making <style> tags on every page makes the page load time only longer... Simply create a <link> with the stylesheet type. :-) And of course you can simply use <span style="font-weight: bold;"> but that aside.

Either way.


All times are GMT. The time now is 03:44 AM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0