Posts Tagged ‘CSS’

MySpace Layout Design: A Fun-Filled Journey

So, you want to design a MySpace that doesn’t look like your typical Tom-approved page. Well, be prepared to enter a fun-filled journey that will involve weird coding, browser incompatibility, and my personal favorite – constant MySpace code changes that will likely ruin your page.

How do you combat this? In some cases, you can’t – if MySpace changes something significant, there is a possibility that no matter how well designed your page is, it will still throw it off. But your best bet to avoid as much of this as possible is to keep your coding simple. You can still make a very intricate looking page with fairly simple code – and the less convoluted your coding is, the less likely it is to not work tomorrow. Here’s five tips that should help you create a MySpace page that doesn’t look like this: http://www.myspace.com/ffrreedd

1. Use layout creator sites for what they’re good for – the basics.

There’s loads of layout sites out there that’ll let you enter exactly the layout you want and promise to give you the code to make your page look just like that. The problem is, most of these sites aren’t exactly up to date, and your page won’t look right when you actually put the code into MySpace. Or, it’ll work in one browser, but look like a hot mess in all the others. However, some of these sites are good for the basics. I highly recommend using the Katamari Layout Generator to get the code to hide everything on your page. The coding on here is solid, and it won’t hide things MySpace does not allow you to hide. Which brings me to my next point…

2. Don’t hide stuff you’re not supposed to hide.

Nobody really likes having MySpace ads on their page. And absolutely everybody hates how any links you put on your page get turned into that msplinks crap. My advice to you regarding these issues? Get over it. Sure, you can do a quick search on Google and find the code to hide that top ad bar, but guess what? MySpace knows about that code. And that other one. And that other one you just thought up now. And if they find that code in your profile (which they will because they run periodic checks) they will take all the coding out of your page altogether, thus ruining it. Yes, it sucks. But in my opinion getting rid of the ads is not worth taking that chance. You can still make a beautiful page that leaves all those things in tact.

3. Design first – then start coding.

MySpace coding is difficult enough without trying to do it before you really know what you want your page to look like. I suggest making a version of your ideal page in Photoshop and then starting the process of making your MySpace page look like that. You may realize that not everything you wanted to do is possible in MySpace, but at least you’re starting with a general idea.

4. My Divs: let me show you them.

Once you have your Photoshop version made, divide every individual piece into divs. A “div” is essentially a section of your page. I recommend any time you would like there to be a space between two parts, you make a new div. For example, this is what my page looks like in its finished form:

.
And this is how I divided it into divs:

.
To give you an idea of what the coding looks like, I’ll show you my code for Div 1, which is my photo:

<style>
.Div1 {width:430; height:370;_height:380}
.Div1 {z-index:5; position:absolute; left:50%; top:185px; margin-left:-375px;}
.Div1 {background-color:none ;}
</style>
<div class=”Div1″>
<img src=”http://img.photobucket.com/albums/v703/mirablue/mepicture.jpg” border=”0″ alt=”Photobucket” />
</div>

The top half of your div – the parts between <style> and </style> contains your instructions for where the div should sit on your page. The second half of your div – the parts between <div class> and </div> contains the pictures and text you want to go in that section.

5. Internet Explorer hates you.

Anyone with any sort of web design experience knows that IE is a pile. But, for some inexplicable reason, a lot of people still use it. So, you need to make your page compatible. I can tell you right now that your biggest issue will be with spacing. IE does not read line heights the same way good browsers do, so you won’t be able to simply use the <br> html tag to create your spacing.

You should instead create your spacing through the position of your divs. However, you will still run into a problem with the size of your divs being different in IE – which is where the underscore hack comes in. You can see this in the above code here:

{width:430; height:370;_height:380}

I’m not going to go into how exactly this works – mostly because it’s already been covered by many other people who can explain it far better than me. I’d suggest reading this post from mdibb.net, for a very simple explanation.

- Amirah / blendetta.com

Good Read – CSS: The Missing Manual

When I jumped back into the land of freelancing, I decided that it would be a good idea to brush up on some stuff; do some reviewing. I went to the gigantic bookstore near my house to look for some books. I figured it couldn’t hurt to have some books to refer to if I happened to find myself scratching my head, staring at my computer screen, hopelessly trying to figure my way out of a jam. Once I managed to slalom my way through all of the people on their laptops drinking their coffees, I finally found the “Computing & Internet” wing of the store. I was in disbelief as to how many books there were – thousands on every topic! I browsed through a ton of them, picked out five or six, and hoped they would actually be helpful.

One of the books that I bought was CSS: The Missing Manual by David Sawyer McFarland. It claimed to be “The book that should have been in the box”. After reading the first few chapters I totally agreed with that statement.

I taught myself how to style HTML using CSS many years. I didn’t buy any books to help me – I learned by trial and error using nothing more than Notepad and Netscape Navigator. After reading CSS: The Missing Manual, I really wished that the book had been around back then.

CSS:The Missing ManualCSS: The Missing Manual explains, in plain language – not tech speak, just about everything that you’ll ever need to know about CSS. It is definitely the most well written computer-related book that I’ve ever read. It explains everything from: how to structure HTML for CSS, the importance of Doctype (something that most online CSS tutorials fail to mention), to how media style sheets work. The book doesn’t just show you CSS techniques; it explains why they are fundamental to creating dynamic, multi-browser friendly web pages. It also includes over 100 pages of step-by-step tutorials – great for any beginner! To see the books table of contents, check out the tutorials, or if you’d like to sample the first chapter, visit www.sawmac.com/missing/css.

So if you are just beginning to learn web design, or if you just want to do some review like I did, I recommend picking up a copy of CSS: The Missing Manual.

Mobile Friendly Web Design Made Easy

Razr2Unlike a lot of people I still browse the web, check my email, and send instant messages using my computer – not my cell phone. My Razr2 uses 3G technology so I do get broadband speed, but I personally don’t see the point of surfing on a 2.2” screen. With that all being said I know that I’m part of an increasingly shrinking minority.

Yesterday, I happened upon a Blogging Q&A article on DailyBlogTips.com. One of the questions was about making blogs mobile friendly. I agree with the answer that was given but curiosity led me to check out how 6bdesign.com looked on my phone:

Razr2 Screenshot

It actually looked pretty good! It wasn’t quite as eye-catching as it is on a computer monitor but it was at least navigable. I also decided to check out the link to the dotMobi Emulator; a site that emulates what web pages look like on a Sony Ericcsson K750 and Nokia N70. 6bdesign.com didn’t look quite as good and the navigation was pretty messy:

Ericcson Screenshot

I’m not too troubled by my discovery, but if 6bdesign.com were a site that received lots of mobile visitors, I would be. Just in case your site does receive lots of hits from people on cell phones, here is an easy way to make their experience browsing your site a little better using simple CSS:

Make a separate style designed especially for mobile visitors. Keep in mind that floats, frames, pop-up windows, drop-down menus, and large images probably won’t display correctly on a mobile device. Also, you may want to use display: none; to block your images if your images are too big to display. Also think about how your navigation will look. Remember to keep it simple! You want to make your content accessible first and foremost. Once you’ve finished with the CSS, you can add it to your page. There are 3 ways to do this. Just make sure that the media type is for your mobile-friendly CSS is defined as handheld:

  1. Link to the style sheet:
    <link rel="stylesheet" type="text/css" media="handheld" href="mobile.css">

    I prefer this method. It’s the most effective way.

  2. Import the style sheet:
    <style type="text/css" media="handheld">
    @import "mobile.css";
    </style>

    Although this method will allow the page to load faster on mobile devices, it isn’t supported by all browsers and devices.

  3. Use inline style:
    <style type="text/css">
    @media handheld {
    body { background-image: url(/images/plain-bg.jpg); }
    h2 { font-size: 14px; }
    p { font-size: 10px; }
    }
    </style>

    Since this method defines the styles in the <head> section of your page, it isn’t as preferred as the first method. Anytime you can link to a style sheet you should - it makes your page load faster and allows search engines to index the content of your page more efficiently.

I hope this helps. Please feel free to leave a comment if you have anything else to add!