And of course there are various ways of using CSS aside from defining an inline style tag. But for the sake if this example and simplicity, I'll try to demonstrate the media attribute's usage using the style tag.
The media attribute has 7 kinds. Recently, I've been able to use two of the most prominent ones which are screen and print. Now, I had a requirement to print sections based on what is checked on certain checkboxes. I won't be using checkboxes for this example, but just plain old divs with a style attribute.
[code Language="css"]
<html>
<head>
<style TYPE="text/css" MEDIA="print">
.ColoredDiv{
color: red;
font-weight: bold;
}
.Hidden{
display: none;
}
</style>
<script>
function printVisible(){
//print
window.print();
}
</script>
</head>
<body>
<div id="content1" class="Hidden">
Content 1 Should not be printed
</div>
<div id="content2" class="ColoredDiv">
Content 2 Should be printed
</div>
<div id="content3" class="Hidden">
Should not be printed
</div>
<input type="button" value="print" onclick="BLOCKED SCRIPTprintVisible();" class="Hidden">
</body>
</html>
[/code]
Now try printing it! :)
It's been a while... I haven't written anything good lately (not that I wrote anything good at all hehehe)... I rarely touch my computer, I'm just into playing my PSP. I'm not working on my game either, though I've been taking a look at Lua player for PSP, it allows you to write your own games in PSP using the LUA language, using LUA player(which serves like a virtual machine) to run it. Though, I really don't feel the drive to mke games right now... So much for finding a good artist...
It's been a while since I last read a technical book. I finished reading Head First Servlets and JSP but I don't have the motivation to read it again for the Sun Certified Webcomponent Developer (SCWCD) 1.4 exam since I don't have the budget to buy an exam voucher.
Well... It seems like I've been improving more on my social life than my technical skills recently. I've read quite a number of self renewal and leadership books like "The Heart of a Leader", "Seven Habits of Highly Effective People", etc. Right now I'm reading "The Art of War". I've also been involved in sports more than
Up here, on the 43rd floor from where I'm sitting(not that I have a high position in this company)... Looking at the window, I've been thinking of my next goal... I remember when I was younger... No... Even now... I love to see new buildings rise... For me, it's a symbol of growth, of courage, of determinism... Stand tall, and be tough. The foundations has to be strong, or everything will fall apart. The latter reminds me of my master's lesson, "You master the basics, you have conquered the language". Of course, we were talking about programming languages back then (whoah, I must have mentioned this a number of times somewhere).
I've learned quite a lot of things in my new job, both technical and non-technical like... Well... Preparing status reports, making impact analysis and a lot more... This is all new... Hmmm... My communication skills with our clients must have gotten a little better as well...
Only five months left before I have my first baby... It sure feels exciting and at the same time... A little weird... I'm gonna be a father... Sometimes I feel like I'm not acting and/or living like one yet... I still tend to be selfish and do things on my own, like... Well... Going to amusement centers (arcade games). On my way to work, I figured out that I've been spending so much time and money in video games again lately. Let's see... 2 hours on amusement centers, about 30 minutes on the train, 2 hours at home... So that's about four to five hours of play everyday... About 35 hours a week or 1 day and almost half a day? Hmmm... That's a lot... I hope I finish the game I'm playing soon hehehe.
Wait... Not that games doesn't give me anything good. It's where I get quotes like "Embrace your deams, and honor" and "Unttainable dreams are the best kind?". Got a clue? I like playing RPG games, REAL RPG Games and not just some crazy MMORPGs that wastes my time...
I really want to buy a new laptop... For some reason, I just can't afford to buy one. I can use a credit card and paying the monthly bill shouldn't be too much of a burden, but whenever I storm to the mall and make the decision to buy, It would suddenly enter my mind that I still have an old one, which still works, and that I have other priorities.
Well look at the time... It's time to finish my task for today...