do you know css
Moderator: General Moderators
do you know css
Hi
I don't know css.
Do you thinks that makes a big problem for me as a php programmer
I don't know css.
Do you thinks that makes a big problem for me as a php programmer
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
If you plan on being a web developer that does more than server side coding then you will need to know most the newer levels of (X)HTML as well as CSS. Not knowing them makes you that much less of a valid choice for clients.
Frontpage is crap. Don't use it. Dreamweaver is also crap, but it does a decent job of writing CSS. I would recommend you learn CSS (the way you learned PHP), get a light editor (Notepad2 or Programmers Notepad) and starting making CSS rules for generic templates to see what it does (you know, kinda like the way you are supposed to try things in PHP to see what they do?).
Frontpage is crap. Don't use it. Dreamweaver is also crap, but it does a decent job of writing CSS. I would recommend you learn CSS (the way you learned PHP), get a light editor (Notepad2 or Programmers Notepad) and starting making CSS rules for generic templates to see what it does (you know, kinda like the way you are supposed to try things in PHP to see what they do?).
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
Not "easy." Just like PHP, you will likely run into a lot of problems due to a lack of understanding. There are concepts that are different, and a lot of things where the only way you'll really understand it is to actually DO it. foreach is a PHP thing, float is a CSS thing.Chalks wrote:incidently, CSS is _very_ easy to learn. Just search google for "CSS tutorial", and you'll find plenty of resources.
Heck, I even taught my mother how to do some css so that I didn't have to keep changing her site... and she hates computers.
If anything, make sure that you learn and *understand* the box model. Margin, border, padding, content.
I guess it depends on how you define "easy". I simply meant that compared to php, css is a breaze. You don't have to deal with functions, classes, objects, built in functions, predefined variables, etc. I could teach css to a brand new beginner _far_ easier than I could teach php... the concepts are simpler.superdezign wrote:Not "easy." Just like PHP, you will likely run into a lot of problems due to a lack of understanding. There are concepts that are different, and a lot of things where the only way you'll really understand it is to actually DO it. foreach is a PHP thing, float is a CSS thing.
If anything, make sure that you learn and *understand* the box model. Margin, border, padding, content.
Edit: I suppose I may feel that way because I'm more familiar with css than php though. *shrug*
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
I guess also because as PHP programmers, we spend so much time on the back-end that we don't put that much effort into the CSS part. A lot of the more experienced programmers here still run into big CSS problems.Chalks wrote:I guess it depends on how you define "easy". I simply meant that compared to php, css is a breaze. You don't have to deal with functions, classes, objects, built in functions, predefined variables, etc. I could teach css to a brand new beginner _far_ easier than I could teach php... the concepts are simpler.
Edit: I suppose I may feel that way because I'm more familiar with css than php though. *shrug*
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
- Ollie Saunders
- DevNet Master
- Posts: 3179
- Joined: Tue May 24, 2005 6:01 pm
- Location: UK
CSS syntax is easy but CSS based design is not. Truely.
I've read two books on CSS and have been using CSS based design and following blogs about it for almost 2 years and I still experience problems that require some creative thinking.
On one hand I'd say it's seriously worth learning because you can't really be left on your own to produce something without it but on the other it's a really big pain in the ass that you're better not being bothered with. For your CV's benefit you should probably do it. I recommend Bulletproof Web Design and the CSS Anthology and then there are a bunch of good sites: It's also well worth using simple PHP so you can compute CSS expressions and deliver slightly different CSS to different browsers.
I've read two books on CSS and have been using CSS based design and following blogs about it for almost 2 years and I still experience problems that require some creative thinking.
On one hand I'd say it's seriously worth learning because you can't really be left on your own to produce something without it but on the other it's a really big pain in the ass that you're better not being bothered with. For your CV's benefit you should probably do it. I recommend Bulletproof Web Design and the CSS Anthology and then there are a bunch of good sites: It's also well worth using simple PHP so you can compute CSS expressions and deliver slightly different CSS to different browsers.
Code: Select all
<?php
header('Content-Type: text/css');
$browser = get_browser(null, false);
$width = 600;
$leftWidth = 200;
$rightWifth = 205;
?>
body {
<?php if ($browser->browser === 'IE'): ?>
width:850px;
<?php else: ?>
min-width:500px;
max-width:1150px;
<?php endif; ?>
}
#main {
width:<?php echo $width - $rightWidth - $leftWidth?>px;
}
#left {
width:<?php echo $leftWidth ?>px;
}
#right {
width:<?php echo $rightWidth?>px;
}
etc.