Thursday, October 27, 2011

CSS Relatively Absolute

The original post for this topic no longer exists.

Even though this is super old and outdated (somewhat irrelevant), I'm reposting this because I like it and drives home some good points for beginners:

Web design usually means something more than just fonts, colours and graphical elements. It also implies some sort of layout. A web designer has three available tools for creating a layout:
    * tables,
    * floats,
    * positioning.
Layout tables belong in the last millennium. Floats are often the best solution, especially when you don't know in advance which column will be the longest. Older browsers, and Internet Explorer, aren't too good at dealing with floats, though. Besides, that's a separate topic.
Positioning is perhaps one of the most misunderstood parts of CSS 2. Let us look a little closer at how it works.
Absolute positioning is sometimes referred to as CSS-P. Beginners using Dreamweaver tend to call it layers, which is unfortunate, because it can be confused with Netscape's proprietary <layer> element.
But let's start from the beginning. The position property in CSS accepts four different values (plus inherit):
    * static,
    * relative,
    * absolute,
    * fixed.
For all values except static we can affect the element's position through the top, bottom, left and right properties.
Static Positioning
Elements with position:static, which is the default value for all elements, are not positioned at all. Their placement on the canvas is determined by where they occur in the document.
Thus the static value is only used for overriding a previously set value.
We will use the term statically positioned in this article, even though it isn't fully correct.
Relative Positioning
Elements with position:relative are positioned relative to themselves. This may sound strange, but it can be useful sometimes.
If we specify a value for either of the four edge properties, the relatively positioned element is shifted in relation to the position it would have occupied if it had been statically positioned.
This may sound like Greek to you, but it's actually quite logical. If we just set position:relative on an element, without specifying any of the edge properties, the element ends up exactly where it would have been if we had set position:static, or if we hadn't set position at all.
If we set top:10px, the element is shifted 10 pixels from its original top edge. That means it moves downward. A negative value shifts the element in the opposite direction, so we could achieve the exact same result by setting bottom:-10px. This means it's not meaningful to specify both top and bottom, or both left and right. There may, however, be reasons for specifying, for instance, top and left together, if we want to shift an element both vertically and horizontally.
Now, this isn't very useful for creating columns, because a relatively positioned element remains in the document flow ? in the position where it originally was. It still takes up space, but not where it's actually shown, but where it would have been shown, had it been statically positioned.
What does this mean in the real world? Relative positioning is mostly useful for shifting an element a few pixels in either direction, or you'll get a hole in your page. There is, however, another use for it that is much more important: A relatively positioned element counts as positioned, even if we don't shift it a single pixel in any direction. We will soon see why that is important.
Absolute Positioning
What people normally mean by positioning, CSS-P or layers, is elements with position:absolute. The top, bottom, left and right properties specify the distance to the corresponding edge of the element. But from what?
Ironically, absolute positioning is relative. Yes, you read that right. An absolutely positioned element is positioned relative to another element, called the containing block. Here comes the definition of that. Take a few deep breaths and hold on tight to the armrests of your chair.
The containing block of an absolutely positioned element is its nearest positioned ancestor, or, if there is no such element, the document's initial containing block.
By positioned ancestor we mean a structurally superior element whose position property is absolute, fixed or relative. So here is that important use for relatively positioned elements that we touched on a minute ago. By setting position:relative for an element, without shifting it at all, we can establish a new context for its absolutely positioned children. Sounds easy, doesn't it?
But if there is no positioned ancestor then? That's where the so-called initial containing block comes into the picture. The CSS standard helpfully says that this is chosen by the user agent. (User agent is the application that processes a web page, for instance a browser, some assistive technology, or a search engine.) The standard also states that it could be related to the viewport. In practice this means either of the BODY or HTML elements.
Absolutely positioned elements are completely removed from the document flow. This means they don't take up any space. Or, to phrase it differently, they don't affect subsequent elements. We thus have to make sure ourselves that no other content ends up underneath our positioned element, unless that is the very effect we're after, of course.
An absolutely positioned element with top:100px is consequently placed so that its top edge is 100 pixels from the top edge of its containing block. In browsers that support CSS you can specify all four edges and let the browser compute the width and the height. Unfortunately this doesn't work in Internet Explorer, so it's almost always necessary to specify at least the width of an absolutely positioned element.
It is perfectly legal to specify negative values for the edge properties, but if you do, you should be very aware of what the containing block is. Otherwise you risk putting the element completely or partially off the screen.
Fixed Positioning
We established earlier that absolute positioning is relative, so it should come as no surprise that fixed positioning is absolute.
An element with position:fixed is positioned absolutely with respect to the viewport (the browser window). Fixed positioning is very similar to absolute positioning, but there are differences. The position is always computed with respect to the viewport; the viewport is always the containing block. The element is removed from the document flow and it stays put even if the user scrolls the document.
Unfortunately Internet Explorer doesn't support fixed positioning. There are a number of more or less complicated ways to circumvent that, but fixed positioning isn't actually as useful as one may think. Sure, it's conceivable to have a menu in the left or right column that is always visible, but most users today expect everything on the page to move upwards when they scroll.
Finally
Absolute positioning is useful for multi-column layouts, as long as you always know which column is longest. Since the absolutely positioned elements are removed from the document flow, the don't affect subsequent elements. Therefore it is very difficult to have a full-width footer appear after all the columns.
As with any web design, you should try to use relative units with positioning, so that the layout can adapt to different window sizes. The value for left, for instance, should be specified in em or %, not in px.
If you specify the width for an absolutely positioned element, either explicitly via width in percents, or implicitly via left and right, the standard says that it should be computed relative to the containing block. Both Internet Explorer and Opera get this wrong, unfortunately, and use the width of the parent element as the basis for their computations. Gecko-based browsers like Mozilla and Firefox behave correctly.
With all types of positioning, including relative, you should set margins and padding explicitly, especially if you want it to look the same cross-browser. Browsers have different standard values for these properties.
When positioned elements overlap, we can control the stacking order with the z-index property. The higher the z-index, the closer to the user the element ends up. Unfortunately this isn't quite as straightforward as it sounds, since each containing block establishes its own context for z-index. So to put one element on top of another element, with a different containing block, you need to increase the z-index for the first element's containing block. In really complex layouts you can find yourself in impossible situations, if you want to stack three elements where the middle one has a different containing block than the other two. As far as we know, this cannot be done.
Absolute positioning is often used with DIV elements, but it's perfectly valid to position any element.
Related Links:

Wednesday, July 13, 2011

Surprise Baby Shower at work

Surprise Surprise!  They had a surprise baby shower for me at work.  I had no idea.  I thought I was just headed to another 2pm meeting.  I had gone to my Dr. appt in the morning that took forever, so I was a bit flustered from that and traffic.  Finally made it to work at 11:20.  Plus I had dropped grape jelly all down the front of my shirt, so I have these stains right up front and center.  Let's add on that the fact I hadn't eaten lunch yet.  So when I walked in and they said surprise...I really was.

It was such a pleasant surprise though.  Melissa Hayden made these delicious cupcakes and gluten-free brownies.  They had a fruit tray and Hershey's chocolate mix....perfect for midday snack.

Sunday, May 22, 2011

Oh well

The crib I liked from JC Penney is no longer on sale.  Oh well.  I guess we'll have to get it off of Amazon.  I wasted a lot gas and time looking for it.  JC Penney outlet didn't have it.  I found out that furnishing are only sold at the JC Penney Home Store at 119th and Metcalf.  And this Home Store doesn't have a nursery section.  They also don't do the big catalog's any more.

I keep getting drawn back to a more seafoam green, so that's probably what I'll get the walls painted.  I still like the alphabet theme.  I came across this alphabet room I love, but I don't have the time or money for all this.  Check it out.

http://www.nurserymuralsandmore.com/2008/09/overlapping-alphabet-nursery-mural.html


I'm leaning toward this bedding set.


http://www.diapers.com/products/Kids-Line-6-Pc-Crib-Set-My-First-Abc-70841?site=CI&src=gnew&cm_mmc=cse-_-nextag-_-nursery-_-QI-712&srccode=cii_9324560&cpncode=22-114613248-2

Tuesday, May 10, 2011

Doing good

Had my last monthly appointment today.  Appointments from here until delivery will be every 2 weeks.  Had my second ultrasound.  Wow how she has grown!!!  Got another picture...still not all that good because she's a mover and a shaker :)

You have to look at it from the side (tilt your head to the right).  She kind of has her chin up.  The umbilical cord was blocking part of her face.   She was moving too much to get a better picture of her.  I figure she'll be here soon enough :)  I'll take plenty of pictures of her.

Everything is good so far.  Her heart is good, saw her little feet, hands, legs and arms.  Spine is good.  Her head is a little big, but nothing abnormal.  At 29 weeks, she is about 3-3.5 pounds which is in about the 54th percentile (normal range).  She's a bit of a chub:)  She's in the downward position and her head is below the fibroid on my cervix right now.   Plenty of amniotic fluid is in there and the placenta is in the right place.  Her heart, kidneys, lungs looked perfect.  Umbilical cord had 3 valves which is perfect.  My glucose test came back normal, but my iron is low...gotta take iron supplement. 

Baby girl is very very active, which I am happy for.  I am quite tired all the time and hungry all the time. My stomach is pretty big. I'll have to take pictures soon.  I have to admit I was a bit worried about the fibroids, but they don't seem to be interfering at all with the baby.  So I'm more relieved.  Watching the ultrasound today, I saw her full face (just couldn't get a picture of it).  It's amazing to see how much she's filled out and she really looks like a baby now.  I almost cried because she's almost here.  I'm scared and excited at the same time.  Soo much to do though...

Sunday, May 1, 2011

Alphabet Nursery Theme

Finally getting settling on some ideas for Kid Kuddles nursery theme.
I think I'm really sold on the alphabet theme.  I'll get the walls painted a soft green (right now I like Lantana Lime from Olympic Paints). 

I am going to get the bookworm wall decal.
Maybe I'll put it over a litte bookcase OR a wall shelf like in the picture by my chair.
I want to get another wall decal for a growth chart...maybe a tree or something.

Over the crib I want to either put a prayer or princess tiera.

http://www.etsy.com/listing/65627534/baby-of-mine-31x22-vinyl-wall-quote


On the wall I want to put some classic flash cards.   I think I'll put them up on the wall above the dresser.
It depends on which ones I get.



Side note...just saw the cutest little outfit
http://www.lordandtaylor.com/eng/Kids-newborngirls09months-newbornessentials-Baby_Bear_Footies_With_Hat___Smart_Value-lordandtaylor/34152/?utm_source=GAN&utm_medium=Affiliates&utm_term=na&tag=GAN&ctcampaign=221&utm_campaign=ShopStyle.com&utm_content=&cm_mmc=Affiliate-_-GAN-_-ShopStyle.com-_-Primary

Wednesday, April 27, 2011

Ugh...a bad week

Hormones are raging and have me trippin.  Can't sleep.  And to top it off, dizziness went to a new level.  Doctor's office had said with the increased blood flow standing still can be a problem.  Gotta keep movin or I could pass out.  At week 28 I am finding I gotta listen to my body.  If  not feeling great, just stay home and rest.  I do feel better know this is within the normal range of things...nothing big is wrong. 

Found out some fun facts based on  July 21 due date:

  • Zodiac Sign: Cancer
  • Half Birthday: January 19
  • Birthstone: Ruby
  • Birth Flower: Larkspur or Water_Lily
  • Your baby will be born in the Chinese Year of The White Metal Rabbit
  • This time next year your baby will be 40 Weeks Old!
  • Your baby will start kindergarten in 2016, be old enough to drive a car in 2027, finish high school in 2029, and will graduate from college with the class of 2033, give or take a year.

Wednesday, April 13, 2011

Wow...my cuz hooked me up

My parents brought the baby stuff my cousin gave me.  WOW!!!  She really hooked me up!!!  I don't have to buy clothes for over a year.  She also gave me the most adorable diaper "cake".   Got a car seat, playard with bassinet, bouncer, walker and 2 crib sets. 


For those that want to know, I'll probably have a bee/butterfly/flower theme.  I'll post some more pics a little later.





Here is the other set:





Here is the diaper cake:


Monday, April 11, 2011

Nursery Theme idea

Since neither of the crib sets I posted where too popular.  I started thinking about the bookworm theme Yvonne suggested more and more.    Michelle suggested words with pictures or even nursery rhyme characters and mixing and matching.

With that being said, I came across this cute wall decal of a bookworm.


I can get it in several different sizes...and it's pretty reasonable.
http://www.etsy.com/listing/71621477/sale-50-off-bookworm-9x9-white-vinyl


**update**  I like these alphabet wall decals


http://www.wallstickeroutlet.com/wall-decor-detail.php?RecordID=65946

OR this one:
http://www.wallstickeroutlet.com/wall-decor-detail.php?RecordID=66732


OR this one:

http://www.toysrus.com/product/index.jsp?productId=3144496&prodFindSrc=rv

So then I went back to my idea of alphabet them.   What if I put some cool looking "flash cards" of the alphabet on the walls.
http://www.landofnod.com/wall-cards-and-letters/kids/not-your-usual-alphabet/f7049

These are the colors, but I like the feel of these cards.   Or something like this:





http://www.landofnod.com/wall-cards-and-letters/kids/1



Here are some alphabet crib sets I thought where kinda cute:



 Migi 4 Piece Blue Alphabet Crib Bedding Set


CoCaLo Baby Alphabet Soup Crib Bedding Set



My First ABC



Kimberly Grant ABC & Me




The following two cost too much:


ABC Sampler





Pink Alphabet



So what do you think?

Wednesday, April 6, 2011

Lil Buddha

Feeling like my  stomach is gonna bust today.   I swear my belly is growing everday.  I feel like the laughing buddha.  Just rub my tummy counterclockwise and say "Lucky, Lucky"

Wednesday, March 30, 2011

Getting Registered

So I'm trying to get started with the baby registry, but there is just so much stuff.  I'm trying to choose the theme for the baby room and I'm kinda stuck right now.  The nerd part of me wants books, and words, and math problems painted on the walls...but I have to keep in mind, this is for a baby.  It's gotta be fun and cute.  But as you all know, I have aversion to all the cutesy, pink, ruffle stuff....yuck.  About the only thing that I have decided is that I want the walls to be a soft or sage green.  Muted and calming.

With the help of my family and friends, I have decided to go with the DaVinci Parker crib....now just deciding if I want the lighter Oak wood or darker Coffee wood color.

Now that the weather is a little warmer, I'm feeling more motivated to go look for all this stuff.  Besides the prompting of Baby Girl...she is really moving around ALOT lately.  I think she's trying to tell me to get a move on it.  I'm thinking if I can at least decide on the crib set, that will set the tone for everything else.  I'm going to try to match the stroller and other stuff with the crib set....oh the decisions to make!

I do have to say I am continually humbled and filled with gratitude by all the support I'm getting.  Just found out my cousin Tammy has a ton of girl stuff she can give me...including the bassinet I was looking for.  My cousin Kim is going to drop it off to my parents.  Another friend, Tosha, is dropping off baby stuff to me this week.  It's all gonna be alright.  Man I am reminded how God is a provider!!!

Back to the baby registry,  as I said I am still in the beginning stages...but I started a baby registry at:

Babies R Us
http://www.toysrus.com/registry/index.jsp
Registry #:  46754549




Target
http://www.target.com/registry/baby/YFSCP1KKNP06
Registry ID: 014399701677027




To be continued....

Wednesday, March 23, 2011

23 weeks

As of 3/24/2011, I am 23 weeks preggo. I'm still freaking out about the whole thing. However it's finally starting to settle in with me. I have amazing friends and family that are helping me through this whole thing. I am so grateful and am leaning heavily on everybody for their support. There so many decisions to make, and soooo much I need to do to prepare, it just adds to the whole feeling of being overwhelmed by this unexpected turn in my life. I do recognize how I have a littel miracle growing inside me. It's truly amazing. I went to the OB today and heard her little heartbeat again...truly amazing. Everything checked out OK. My blood pressure is really good. I only gained 3 pounds from my last office visit last month, but it feels like I've gained so much more. The next office visit will be the glucose test. Baby Girl has been really active today...it still feels pretty funny feeling her moving around in my belly. Still am getting used to that.

I haven't set up a baby registry anywhere yet.   Although I did start creating a wish list on Amazon.com:
Amazon Wish List

I gotta start making decisions on what to get pretty soon...but for now I'm just compiling a list of stuff for Kid Kuddles.