PSD to HTML 4.5) Arranging the Feature Section
Transcription of PSD to HTML 4.5) Arranging the Feature Section
hello and welcome back to the PSD to HTML responsive
portfolio build in thislesson
we’re going to tackle the Features section here and how it’s going to
behave when we hit that 640 pixel break point at that point I want to go ahead
and split it into these three separate stack two layers instead of having
them lined up in three columns we want it to be stacked on top of each other
so as we mentioned before in order to do that we’re going to take away the background
image from the list itself a background image supplied to the unordered
list we’re gonna take that away and then reapply that background image
to each individual column which they won’t be columns anymore and we’re just
going to position that background image differently in each of those three columns
so that even though they all come from the same image gives it a little
bit of variety and looks really nice so we’re gonna do that now let’s jump
back into text made and we moved everything into the site 23 folderol the changes
we make in this lesson will be saved there and we’re going to be dealing
with the same media query we’ve created with the max width 640 at that point
we’re going to break this feature list down so against our featured section
in its contained inside a unordered list with a class of feature hyphen
list so its point to that feature list class and in first of all we’re gonna
take away the background we’re gonna sit background equal to none were also
going to set the width to 100% so that it takes up the entire wit of
the browser we’re gonna take away margins set it to 0 and and let’s see how
it looks will see that jump back into chrome and refresh and there we go so
as you can see once we get to that 640 our margins and padding go away on the
edges and our background image disappears also I want these Collins to disappear
and I want them to be stacked on top of each other so we’re gonna have to
go into the list items themselves to do that so here’s our featureless rule here
now we’re gonna skip a couple lines include another rule for feature list space
allies of the list items themselves the individual list items inside
that so for those lists items were going to grab that background image go
ahead and scroll back up to our original feature section and here we have
this background image of plane to the feature list we’re going to a play that
now it’s copy and we’re gonna play that now to each individual list item inside
that list and that’s gonna change when we reach 640 pixels let’s paste property
there only difference is I’m gonna get rid of all of this extra stuff here
I’m not gonna have the positioning in the new repeat instead reduce can have
the URL we’re going to position them separately because each individual section
is going to be positioned differently but they’re all going to have
the same image in the background so once we’ve done that we also want those lists
items to stop the loadings were gonna set the float property to none really
set it at a height of 120 pixels which is the same height that was used in
this Photoshop file each of these is 120 pixels tall will jump back into our code
here and we’re gonna get rid of the right borders on these so order
Hytrin right we’re gonna sit that and let’s also go ahead and make that important
as I’m not so sure that work without the important we need to make sure
that it does override that and then we’ll sit border hyphen left to known as well
then instead of a left and right border if we go back to her photos show how
we can see that each has a bottom were on it so for those lists items will set
border hyphen bottom to 1 pixel solid white each list item is going to be
100% of the width of the browsers and bring that with up 200% we’re gonna change
our textile and is right now the text is aligned to the center in order to
get those icons and text centered in the news items those lists items but now we’re
going to align the text to the left and let’s see how that would look so
it seemed that jump back into chrome and refresh and there we go we’re getting
a little bit closer to what we’re going for but obviously we’re still
not quite there yet if you remember when we originally created these
columns we had a hundred pixels of padding placed in the top of these lists items
let’s get rid of that padding and that should pull our icons back up with the
where they need to be excuse me so for this feature list these Li elements within
that featured list were gonna set or padding back 20 save that and refresh and
that brings as icons back up closer to where they need to be and
we’re getting there now we need to design services been kind of being sucked
up into that section and that’s because that section it’s having it’s which
set to exactly one hundred and twenty pixels so instead of doing that I want
to set the heights to auto for that feature list so we’re gonna change the value
here to do so automatically
adjust instead of being set specifically to a given high school say
that and refresh and it said 220 pixels I was confused 220 pixels is where
we want those lists items to be but up here near the top when we first created
that feature list the fight was set to 300 pixels so even though we were taking
up more than 300 pixels of height it was still trying to set the height 239
pixels so this design services was pretending like that I was set to 300 pixels
it was being kind of sucked up over that background image but now we’ve got
that settled by setting behind down here at the bottom scroll the way back down
saying that height for the featured list unordered list to octo so now some back
into our HTML real quickly so we can see what she looks like for that featured
section remember we have our list items and in inside that we have an anchor
tag in the anchor tag we have an image with a classic feature icon and nh3
with a class of feature title so those still need to be arranged we go to a
Photoshop file with the icon to the left and the text to the right so let’s do
that we’re gonna come down here blower feature list Li rule and create a new
rule for feature hyphen icon which is again the class name given to those images
those iconic images and we’re gonna float those to the left and let’s set
margin top because the right now that are aligned to the very top of that list
item said margin top 228 pixels and that won’t get it where it needs to be it
will not down
and to get a little space between the icon in the text that’s going to show
up next to it let’s also give its a margin right property of about 20 pixels so
it’s going to see that and refresh your page and we need to go into your browser
and refresh your page there we go in a little bit closer to where we need
to be now we just need to vertically center of that text in the way
we’re gonna do that is pretty easy we’re going to set D line height for that
text to the same height as the list I’m itself which is a hundred and twenty pixels
when you set the line height to the same height as the container element it
will automatically vertically center the text for you if that text point this out
if that text is only one line of text if it’s two lines of text then it won’t
work at all so if you’ve got more than one line of text you don’t want to do
it this way but we know that this text is only going to take up online so what
we can do is let’s go back to the rule for those h3 tags so we have a feature
actually they’re called feature title as h three tanks have a class of future
titles so we can just give that feature title Class A line height of 120 pixels
which again is the same as the height of the list item itself when we do
that and refresh your page you’ll see that our text is now vertically centered and
now that section is looking really nice thing I wanted to know as may be set
some left margin to those icons feature icons the emergent operate let’s go
ahead just create a comprehensive margin rules emerging top is going to be 28
pixels and then we hit two margin right which is gonna be 20 pixels and we have
the bottom margin will set that 20 in the left margin but said that 210 pixels
and then get rid of these other to the margin topping margin right let’s save
that and refresh and then manages it over so we have a little bit of spacing
between the less the
icon in the left edge of the stage so then I wanna do one more thing and it’s
gonna be pretty simple just went to vary the position of the background images
for these three sections and those three sections if you remember have
different class names the web section is called feature hyphen web and we’re
gonna said its background hyphen position property to top left corner copy
that and paste it two times our second one is called feature hyphen graphic
and we’re gonna said its background position to bottom center you know
we’re really doing here is varying the position of it to give it a little bit
of variety there so our third one is called featured video and we’ll give it a
background position of center right so we’ll save that jump back into our browser
refresh and we’ll see then nothing changed their we need to make sure
that those are the right class names and we haven’t actually played those
class names yet so inside our feature list also gonna give each one of these
a separate class name so that we can position those so allies gonna have our
first allies gonna have a class of feature heightened new web and this should
take care of everything her second one will have a class feature hyphen
graphic and then finally our third list item will have a class of future
wife and video let’s try that again and refresh and
it might help to set our background and said she’s in background we’re gonna set
this to background image and I think that might take care of it will see that and
will jump back into chrome and refresh and there we go so
now our background images the same for all three they’re just positioned differently
so now in a figure out why there’s a little bit of space in between each
of these items I might be a padding issue will just right-click inspect element
and it looks like it might be a margin issue because we hover over that there’s
a little bit of orange space there you can scroll down to the bottom and
margin is that weird species 5 pixels of margin according to this so we’re
looking for some top margin and we’ll just go into those lists items there
and we have no margin sets was just said margin 20 save that and refresh
and will maybe set will get a little more specifics emergent top 20 and
said it too important save
it and refresh and it might have something to do with these h3 tags here so
for those h3 tags which are these feature titles were also gonna set the margin
for those 20 save it and refresh and there we go that gets rid of the extra
spacing sometimes when you have extra space in like that you want to look
at the elements around it and you’ll often find that when you have weird
spacing issues like that it it is often the result of an h1 or h2 h3 tag that’s
applying its own margins here in there so that takes care of that issue and
we can move on with the next video thank you for watching
PSD to HTML 4.5) Arranging the Feature Section
Reviewed by Tayyab Saqlain Zakki
on
00:04
Rating:
Reviewed by Tayyab Saqlain Zakki
on
00:04
Rating:

No comments: