PSD to HTML 3.12) Laying Out the Columns
Transcription of PSD to HTML 3.12) Laying Out the Columns
hello and welcome back to the PSD to HTML responsive portfolio build now butwe exported our images for use in the portfolio section here it’s time to start styling and getting it to look great and if we jump back into Photoshop we can see what it’s supposed to look like and as we mentioned before we’re gonna be using these images as back ground images four of those sections and then as we resize our browser the size of those blocks of content are going to grow or shrink depending on which way you’re moving your browser and as they grow and shrink the images inside them aren’t gonna grow and shrink with them instead we’re gonna be revealing in concealing parts of the image inside them and I think it’s going to make for a really cool effect as when resizing your browser so let’s start by taking a look at our each team and we’re working on the site 16 folder it’s the same folder we had open in the last video we didn’t change need the code itself so we’re going to work with the same files here the only difference is now we’ve moved our images are saved or images in the site 16 images folder so we now have those available to us here and if we come down to the portfolio sample section we can see that it’s all contained within a section element with a class of portfolio section inside that section is a did with the class of container because remember we go back to her Photoshop the portfolio section has a background in light grey background that supposed to extend all the way to the edges so these section itself takes up 100% of the width of the browser but the div inside that section of the class of containers what’s going to continue our content and keep that content the same width as the rest of our content so again the portfolio samples class will have that great background that extends all the way to the edges and in the container inside it will have our content so let’s go ahead and start with a portfolio samples class here let’s jump into our CSS and scroll down to the bottom and create a new section here and will call the section portfolio or portfolio samples whatever you want to call it and will point to the port folio hyphen samples class there which is the name for the class name that we gave to that section and we’re gonna give it a background color is gonna be like great color we’re going to get a value of da da dee a good and save that and jump back into your browser and refresh and now we can see our portfolio section has that background and now that we have that light grey background we can actually see those icons showing up there and that’s a good start so now we’re gonna go in to go back to HTML and take a look at our portfolio items notices contained in an unordered list with a class of portfolio list and each list item is another one of the columns in that layout so we go back to our current each you know how we can see that we still have bullet points here and we want to get rid of those let’s make some edits or add some new styles I should say we’re gonna point to that portfolio list class that portfolio was class the class applied to the unordered list itself and we’re gonna give it a list style of known as a refresher page and now the bullet points a gun so now we’re going to add it to the list items within that list in these lists items are again the items that are going to serve as the four columns or be four sections of our portfolio samples and we need to point to the list items inside that list so we’ll put portfolio l’espace Li and for each of those lists items were gonna go ahead and give it a darker gray background color just think he’s the images don’t import right or whatever but let’s give it a different background color of pound 555 and we’re really not gonna see that much if we save it now and refresh will see it but once we put the images in the background and things like that those that dark grey background will go away but again we just have that there in case for some reason the images don’t load so it still says stands out excuse me as a separate section unions no need to figure out how wide that supposed to be so let’s go back into our Photoshop file and we’re gonna go and treat the width for the desktop or for a large browser and when we do some skin option right click on one of these items and they will select that laptop to a player and rumor that laptop layer is basically clipped to the layer beneath it and lay beneath that if we turn that ripped through that image we can see it’s just a square just agree square and that Greece squares what we need to know the size of so we can come and click on the preview area for that squarely or control-click using a PC and then open up our info panel and see that it’s 210 pixels wide by two hundred and ten pixels tall enough to go into those lists items and set the width to 210 pixels and the height to the same 210 pixels say that refresh can go into chrome first refreshed and there were no never over right size we just need to line them up next to each other so go back into our code and make that happen so we want these lists items to float to the left and then in order to species out appropriately first of all school and test it like it is never all next to each other but we need some space between them and these items are each 210 pixels wide so if you add or multiply that by for that gives you a 240 pixels which leads an extra 60 pixels over here on the right because our entire content area is 900 pixels wide well we have 60 extra pixels and we have three spaces here between these images so each one of those spaces is gonna be 20 pixels wide so what we’re gonna do is we’re going to add a margin right property here of 20 pixels now that is gonna break things but we’ll fix it in just a second we’ll save that refresh your page and we see that it almost works but our final piece down here is not down to the bottom why is that we did the math and discovered that with 20 pixels in between each one it should fit within the 900 pixels well yes it should accept that this last item also has a margin right of 20 pixels so that basically makes this last item larger than we needed to be so we’re gonna point to that last item and get rid of that margin rate property so the way we point to that last item is we point to dot portfolio list space Li colon last hyphen child’s like we’ve done before and this time for that last child will said margin right 20 save that refresh your page and now we have our items floating like they need to be you know what’s pulling in our background images each one of these is gonna have a separate background image we need a way to point to each one of those columns separately if we go back into our code into our HTML file can see we’ve already done that we’ve given each of these lists items their own name port laptops poor technique or demo reel port logo so we can point to those four classes separately to import the background image that we need to go back into sight that CSS and let’s do that so point to the first one which again was port hyphen laptops and for that one will give it a background of the URL and then inside print the season inside single quotes will say dot dot / images / laptops . jpg we want to go ahead and try to send to this and see how it looks so we’ll vertically and horizontally center it’s all both properties here to center and then no hyphen repeat so that it doesn’t try to tile and there we go sociale it looks a bit refresh your page and there you go art images now centered inside that background section so will jump to the next item was just highlighting this copy it and then lets pasted one to three times per second one is called port hi send me in the background image here is Acme logo and sexually diet gifts so get rid of that debt JPEG and make it done gif and let’s see how it looks centered save it and refresh and that was ok but I want to try to match it up with what we see in the Photoshop file or receive part of the sea and then most of the AM so we basically need to move it over a little bit and experimenting with this a little bit on my own and I know what values and any use here instead of center center get rid of both of those and we’re gonna change these values will change the the horizontal value to negative 200 pixels that will not get 200 pixels to the left and then the top value we want to pull it up a little bit about 60 pixels or consent that too negative 60 pixels so again that report to the left 200 pixels and up 60 pixels save that and refresh and then gets it closer to where we want to be felt pretty good else do the next section which is called port demo reel for the background here were using an image cold tablet JPEG and we’re going to center that will be there was injured as well the last one is called court logo the background image is also a gift so will highlight the entire file name pair and call it a logo . give and for this one we want to vertically center at both for the horizontal position and said its negatives 10 pixels and destroy that saved her final refresh your browser and that’s not exactly what we were going for lets tribes wouldn’t try horizontally centering that and see if that gets us where we want to be and let’s take a look at our Photoshop file and that works pretty well it will go ahead and leave it right there soon go back to a Photoshop file and take a look at how everything is arranged here and right now you’ll notice we put a gray background on this section earlier but if we go back to it we can see that the green background is ignoring all of these images here and it’s basically just hanging out behind the portfolio text in the reason for that is all of these items are floating to the left so we’re going to use the clear fix hack in order to get that fixed and you can find that very easily online just do a search for clear thick CSS and it should be one of the first solutions here the top so this item at Web Toolkit dot info and we scroll down we can see all the CSS we need for this clear fix hack come up here and click on the second icon here to give us just plain text and get those menus out of the way that we can highlight and copy it and we’re gonna go into our CSS scroll all the way down to the bottom and I’m creating new section here for the clear fix section clear fix and then we’ll just paste everything that we just copied here so all we need to do to get this to work is to give the parent of the food items a class of Clearfix against the parent of the items that are floating the items that are floating here we close that go back to our page the floating items are the list items in that unordered list so since the list items are floating were gonna give the parent or they unordered list a class of clear fix will go back into our code and we’re gonna point to actually go into HTML and find the unordered list we’ve given it a classic portfolio list were also gonna give it a class of clear fix and that should be enough to work her magic still seem that savor site that CSS file and refresh the page and as you can see that brings that gray background down below are images so one more thing let’s jump back into Photoshop file you can see there’s a little bit of space above the portfolio text and below the images towards gonna put some top bottom padding inside that section so jim back into our CSS and for our portfolio samples were gonna add padding here with straight 20 pixels spaces euros of the top bottom padding will be 2000 will say that refresh your page and that gives us a little bit of room but I think that’s a little bit too much room on top up let’s let’s change this the the portfolio text itself already has some top padding or protect margins on it so let’s specified this girls get a little more specific with this top padding which is set that its euro are right padding and serum or bottom padding at twenty let’s go and say that and see how it looks and then we’ll just had a little bit more padding to the top so for the top padding which is this first one will put 435 pixels and see how it looks a bit refresh and there we go that gives us the spacing that we’re looking for so in the next video will finished styling these portfolio sections by styling the captions themselves and so with everything single go ahead and move on thanks for watching
PSD to HTML 3.12) Laying Out the Columns
Reviewed by Tayyab Saqlain Zakki
on
23:55
Rating:
Reviewed by Tayyab Saqlain Zakki
on
23:55
Rating:

No comments: