| |||||||
EnjoyCG is a community and resource for 3d artists, students and designers. Browse our tutorials, read the latest news or ask a question on the forums.
New around here? register| |
| ||||
| Designing your own portfolio website with html & css Why do I need a portfolio site? If you ever want to get a job in the CG industry people will need to know about you (and your work) before they will hire you, and a proffesional looking portfolio is a great way to get to know you! You might already have a simple site, but looks are important, so it's a good idea to invest some time in making a great looking site, which will attract more jobs, or at least increase the chances of getting one. So what are you waiting for, don't miss your chance of a (better) job! let's get started... ![]() Where do I start? Web design isn't as complicated as 3ds max, that's my opinion at least, all you need is a simple text editing application, and photoshop or a similar application for the graphics. So which application should you use? This is quite a personal choice, if you have money to spend and code a lot you can buy specialised software, some examples: Coffeecup, Coda (mac) but usually I stick with notepad (standard on windows). So, before I start designing I usually draw out some ideas, mainly concerning the layout, so sit down take a piece of paper and pencil and get started, this doesn't need to look nice, it's just a general guideline for your site design, you might want to add sizes/dimensions here as well, so what size should you use? Layout and Dimensions First of all, you can use a fluid or fixed layout (percentage vs pixels), or even a combination of both (eg. a fixed sidebar of 200 px and a fluid main content area). I prefer pixels because they're easier to control and will make your layout more consistent. Of course, you can do whatever you want here, but in this tutorial we'll use a fixed layout, if you want to know more about the fixed vs fluid debate take a look at this article. So, we've decided to go for a fixed layout, now we need to determine what size we want, the main thing to keep in mind here is the screen resolution of your visitors, you can get a impression of that via free stat services like google analytics (also very useful to see where your traffic is coming from). So, let's say the minimum resolution to view our site (properly) needs to be 800x600 pixels, ok ok, some people might still have 640x480 but they'll just have to live with a horizontal scrollbar, anyway, most designers/cg artists have large monitors so this is no big issue. so, the width can be 800 max, but remember that there might be a little space used by the browser window and scrollbar, so to keep things safe we use a 700 px wide layout, which also leaves some space on the side for a nice background. We can divide the 700 pixels into parts as well, the header will be 700 px wide, the side bar 200px and the main content area 500 px, finally the footer is 700px again. So we've decided on our layout, let's get started. Step 1: The basic HTML layout We'll dive right in by doing the layout, which is pretty simple, and controlled by CSS (cascading style sheets) w3schools has some good basic tutorials if you've never heard of CSS before. First a little bit of web design history . Ages ago people used to design websites with tables, but tables are not meant for that, they're meant to show data, so they don't work very well. They're larger to load, are not very semantic (correct code, better for SEO (search engine optimization)) and make your code complicated to edit. Tip: Try to keep things simple, fewer So, you might ask yourself, how will this ever display the page I want? With all the settings I want (width, position, etc.), well, right now it won't, but this is were CSS comes in. Every has an "id" property, which we can define in the css part of our file, id's can be used only once, so if you want to apply the same css to multiple parts of content, use classes instead. HTML Code: class="my_class" Doctype Doctype is another important part of html you need to create proper, standards compliant pages, they are quite simple, you just need to make sure you have the right doctype you need, and put that on the first line of your document, this useful article explains doctype well. Step 2: Cascading Style Sheets (css) We're done with the html so far, let's continue with CSS. This is where the fun begins, right now our site looks really, really bad, and in a few minutes it will look... ok, not great yet, but a lot better. CSS is the modern way to style your pages, it's better because it divides content and design, is more efficient and also easier to read (so anybody who needs to change your design will be able to do so easily, which is relevant if you work in a design company.) There are probably many other reasons, but that's not the point of the tutorial. The basic font settings: HTML Code: body{
font: 80% arial,sans-serif;
text-align:center;
color: #000;
} font sets the font size and type, you can choose other fonts that you like, but be careful, few of them are supported by all browsers, here's a useful list(add link here) if you're wondering if your font is recommended. You should be aware of the fact that CSS uses a different syntax than html, for instance, ":" is used instead of "=" and each line ends with a line break: ";". we use % fonts here, because they are scalable in all modern browsers, pixels are not recommended, they do not scale in Internet explorer, readers with bad eyes won't be happy.. Later on we can adjust certain headings by using 'em' sizing, 1 em is the standard size, for a larger header we could use 1.4em for instance. Also notice we have specified 2 fonts, arial and sans-serif, so our first choice is arial, but if for whatever reason it's not available on someone's browser/computer our site will automatically fall back to 'sans-serif', which is a standard font, so it should be available for anybody. text-align: center is used here to align our content container, so does not really affect the text, but is useful to align your entire page. color: simply sets the color of our font, #000 is a hexadecimal value for black, hexa what? here's a useful list of hex colors, or you can also find any color's hex value with your photoshop color picker. If you see some CSS and don't know what it means, you can find out a lot by browsing useful sites listed here: HTML Code: p{line-height:150%} You should understand the basics of css by now, if not, just have a look at the links above, especially w3schools is useful for beginners, gotAPI is the best reference (with search function) and A list Apart is more advanced, but of high quality. Tip: add your css as an external stylesheet, this will make side wide changes easier since you only need to edit one file, it's better for SEO and performance as well. This is the code you need, link it to your stylesheet (simple text document with css declarations in it, saved as .css) Be sure to rename "portfolio_style.css" to your stylesheet's name, if it's online you can also include full (http://example.com/stylesheet.css) urls. Step 3: Changing style with CSS What follows is the rest of the css which determines the look of our page, the layout will be covered after this part. some /* comments */ have been added to explain the css down here: HTML Code: h1,h2,h3,h4 {
margin: 15px;
color: #8b5d26;
font: 1.3em trebuchet ms, arial,sans-serif;
}
p{line-height:150%}
div#content ul{margin:10px 10px 10px 30px}
.padding{padding:15px}
img {margin:5px}
div#sidebar p {
text-align: justify;
margin: 15px;
}
/* URL style */
a:link {color: #5d9e9b; text-decoration: none; border-bottom: 1px dotted #c8dbbf;}
a:active {color: #69bfde; text-decoration: underline}
a:visited {color: #393a3d; text-decoration: none; border-bottom: 1px dotted #c8dbbf;}
a:hover {color: ##5d9e9b; text-decoration: none; border-bottom: 1px dotted #5d9e9b;} Step 4: Setting up the Layout CSS HTML Code: /* Layout style */
div#header {background: url(top_bg.jpg) no-repeat top right}
div#footer{background:url("footer_bg.gif") no-repeat left top; color: #FFF; height:50px;}
div#footer p{margin:0;padding:5px 10px}
div#content{border-left: 2px solid #e0fceb; border-right: 2px solid #e0fceb;}
div#container{background: url(side_border_bg.gif) repeat-y top left;}
/* Layout */
div#header {height: 227px;}
div#container{text-align: left; width: 700px; margin: 10px auto;}
div#content{float:right; width:496px;}
div#sidebar{float:left;width:200px}
div#extra{float:left;clear:left;width:198px}
div#footer{clear:both;width:100%} Here we have separated the layout style, and layout itself, by style we mean colours and background images for instance, layout determines the size and position of elements, this makes editing easier later on. The Header Image is a simple render done with 3ds max, set as a background iamge via css, it's 227px high so we also set that as the header height. The footer also requires a simple background images with a rounded corner, clear:both is used so we won't have any problems with the floated elements above. Furthermore, we've changed some settings slightly, div#content is now 496 wide, because we've added 2px borders as well (496+2+2 = 500) if you're layout is broken up, make sure it fits in it's parent element - div#container in this particular case - Remember, padding and margin also add to the overall width. It's also important to set the margin: auto property for the container, this centers the content on our page. float right and left is pretty self explanatory, if you want to learn more about it read this extensive tutorial about the float property. step 5: Designing the navigation or menu HTML Code: /* menu style */
div#nav {
float: right;
}
div#nav li {
float: left;
list-style-type: none;
}
div#nav li a {
margin: 10px 4px 10px 0;
padding: 5px 8px;
font: bold 1em trebuchet ms, arial, sans-serif;
display: block;
background: #92b681;
color: #fff;
border: none;
}
div#nav li a:hover {
background: #fff;
color: #594d24;
border: none;
}
body#home #nav-home a {text-decoration: underline}
body#news #nav-news a {text-decoration: underline}
body#gallery #nav-gallery a {text-decoration: underline}
body#home #nav-home a {text-decoration: underline}
body#home #nav-home a {text-decoration: underline} the html part is really simple: HTML Code:
Home
News
Gallery
About
Contact
|
| The Following 7 Users Say Thank You to Jelmer For This Useful Post: | ||
CHALLENGER (7th October 2007), dorin (25th September 2007), ExTaZ (6th October 2007), killoskate (7th December 2007), Marlboroman (17th October 2007), robinmitra1 (25th September 2007), the programmer (24th September 2007) | ||
| ||||
| Re: Designing your own portfolio website with html & css having a bit of problem does it make any diffrence where you put it? I can upload my html file nad css so you can see if there is any problem ![]() ScoutiiStar Profile, ScoutiiStar Details - FileFront.com and download the 2 files Last edited by ExTaZ; 6th October 2007 at 01:05 PM. |
| |||
| Re: Designing your own portfolio website with html & css Cool, its been a long time since ive been doin the maxin and such, but i have recently wanted to get into css and html for just this reason, you are once again as usual a star m8, i look forward to completing this tut at some point, just as soon as ive completed some of the modelling ones first ![]() |
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
| |
LinkBacks (?)
LinkBack to this Thread: http://www.enjoycg.com/forums/enjoycg-tutorials/1493-designing-your-own-portfolio-website-html-css.html | ||||
| Posted By | For | Type | Date | |
| News CGI | This thread | Refback | 14th October 2007 02:53 PM | |
| Digg - Designing your own portfolio website with HTML & CSS | This thread | Refback | 25th September 2007 10:23 PM | |
Similar Threads for: Designing your own portfolio website with html & css | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| 3D My Attempt @ Car Designing | vilavb | Finished work gallery | 13 | 24th September 2007 11:52 PM |
| Website prblm | Skullv | Off topic | 1 | 23rd September 2007 06:41 PM |
| My Website | Vikaskumar | Portfolios & websites | 4 | 17th September 2007 05:46 AM |
| My Website: | Madclouds | Portfolios & websites | 3 | 17th February 2007 08:10 PM |