PSD to HTML 3.3) Setting Up the Navigation
Transcription of PSD to HTML 3.3) Setting Up the Navigation
hello and welcome back to the PSD to HTML responsive portfolio built now we’ve got enough funds imported I want to get started moving from top to bottom and will start in this lesson with our navigation so we’ve created a navigation in HTML we use an unordered list for Army navigation and another unordered list for our social media icons over here to the right now we just need to style it appropriately so first thing we see is this background color and F to turn on or toolbars again and see what their background color isms gonna click down here on our color selector in the toolbar and then just hover over the background color in click and we can see the hex value here da da da let’s go back into our HTML and see what it is we’re coding so we’ve got a navigation here and inside that navigation we have it did with the class of containers remember we talked about this before they did with the class of container that container classes going to define the width of our content if we go back to our design and it’s just hit tab to minimize our toolbars there we can see that our content goes from right here on the left edge of the home button to right here on the right edge of the Facebook button but the background for our navigation extends beyond that navigation extends all the way to the left and right edges of the browser so that’s why we put this navigation elements outside that deal with the class of container so we can give this navigation element that background color and then we can put all of our content that’s inside this container we can set the width of a content so that it doesn’t extend outside the boundaries that we have defined so let’s start with the nav element let’s go to our site . CSS file and and let’s skip a couple lines here in the put a line of comments here just says Scott main navigation there we go so we’re going to create a rule for the nav element and since we’re pointing to the element itself from orig typing in the name of the element we don’t need to do anything before so for the nav element we’re gonna give it a background color so background Hyson color colon space given value of the pound da da da so it seems that looks like let’s save that when he jumped back into chrome and Annie to navigate here to cite 08 all of our files have been moved now into the site 08 focus all the changes we make in this lesson will be saved there and we can see here that we have to our two unordered lists the unordered list for me navigation and the unordered list for social media icons those are all contained within this gray background that’s what we’re looking for so far so good so now we can see that are unordered list the bullets have been taken away from it would no longer have a bullet points there and the left padding that is usually there by default on an ordered list is no longer there and and so we can start to slinging these up now by default a list item is a block-level item which means that it’s going to be online by itself and the next block level item which is the next ListItem won’t be online next to it instead it’ll be below it so in order to get this menu to look like what we wanted to look like we’re going to need to change that we’re gonna change these we’re gonna leave it as a block-level element but we’re going to float them to the left so let’s jump back into her code and let’s take a look at our HTML here notice we have a UL with the class of Nev list and another UL the class of socialist now both of these are going to have list items that flute to the left but this social list class the social list unordered list excuse me the list itself is gonna float to the right of the items within it are going to vote to the left so let’s start with our have up here main navigation list so you get a class of nav list let’s create a rule for that Neville list class so . now hyphen list and let’s go ahead and and create some properties here that we want to apply to both in NAV list and the socialist so first of all going to create the appropriate selector here we’re going to point to the novelist class and the socialist class by putting a comment in between those two class names from both of these classes were inside the list style now we can see on our page that looks like the list I’ll is already set to None but if we were to undo this and let’s just say margin left is 20 pixels save that refresh we can see that those lists bullet points are still there but because we took the padding off the list they’ve been nudged off the left edge of the stage we can see them so we do need to turn those lists are those bullet points off and again we do that by setting list style to not see that refresh and Rebecca restarted now we don’t have any bullet points covering off the left edge of your browser window so now I want to float those lists items inside this list in order to do that we need to create a rule for the list items inside both of these lists of nafta list face Li common spaceships common space their ego and then that social health enlist face LA so for the list items inside of both of those lists were going to float those items to the left two women say that and take a look at how that changes things and now you can see that everything is aligned horizontally for that navigation but we have a couple of problems first of all our background color has collapsed we can no longer see that light grey background color and that’s because everything inside that now is now floating and if you have nothing with floated elements inside a parent element than that parent element or those floated elements excuse me are not going to render in the DOM in other words the browser just gonna pretend like they’re not there we can see them here but they’re not holding that containing element holding that an avid element open they’re not holding that height where it needs to be because everything inside its floating well if we didn’t know how tall you want in this navigation menu to be then it would involve a little bit of trickery in order to get this to work right but we know how to all this money was supposed to be so all we need to do is set the height of that now elements we can come back over to our Photoshop file and I’m going to option right click on that green background there are few using a PC you would alt right click and when you do that we open up our layers again and shit tab to turn those panels back on we conceded that layers now selected because we option right clicked on it or altering clicked on it again if you’re using a PC now we know what layer that is we can command click or control-click on the preview area thumbnail for that later and it will make a selection of that later and without selection active we can come over here to the info panel and see the width and height and we can see that height is 40 pixels so we want that now have to be 40 pixels tall to command the control the on a PC to turn off that selection then we’ll jump back into our code and for this never element we’re gonna set the height 240 pixels and now that we’ve explicitly stated what the height is we say that and refresh your browser here we can get that green background back to know we’ve got the navigation menu the basics have it set up anyways in the next video over to go in and work on the contents were gonna work on the text in the images for the navigation says thank you for watching you know see you in the next video
PSD to HTML 3.3) Setting Up the Navigation
Reviewed by Tayyab Saqlain Zakki
on
23:48
Rating:
Reviewed by Tayyab Saqlain Zakki
on
23:48
Rating:

No comments: