PSD to HTML 3.10) Styling the Feature Section
Transcription of PSD to HTML 3.10) Styling the Feature Section
hello and welcome back to the PSD to HTML responsive
portfolio build in thislesson
we’re going to move forward with our feature section we’re gonna have three
columns laid out we can see what we’ve got so far here but if we jump into
Photoshop we can see what it’s supposed to look like so we have three columns
separated by these very thin white borders and we have our icons and our
text centered within those sections so lets go back into text me here and let’s
get started so moved everything into the site 15 folderol the changes we make
in this lesson will be saved there and we’re gonna come down to our feature section
here and let’s get started with our list items within our feature list unordered
list and if we go back to reach team will review how that is all put
together so we have this unordered list for the class of feature list and inside
that we have three list items each list item is going to represent one column
in that set up that we looked at the Photoshop file so each column has an anchor
tag inside that anchor tags in image and in h3 tag so our image as a classic
feature icon I reached three has a class of future titles we need to keep those
classes in mind because we’re going to be using those class names as we
move forward so let’s jump back into our CSS file and let’s point to those individual
list items which if you remember are going to serve as the columns
for this feature section we’re going to point to the feature list class but
I dot feature heightened list space in the list items within that class so far
in his list items let’s go ahead and start by setting the width of these items
so we’re gonna set the width here to 33.3 3 33 percent and that is going to
be roughly one-third of the width since we have three columns each column needs
to be one chart
also I’m gonna set the height here to 300 pixels which is the same height that
we gave the feature list itself so we’re just making sure that the list items
themselves are as tall as the feature list itself then I want these items
to flow to the left because by default these lists items are block-level
element so in order to change that behavior we’re going to float
these items to the left see what that does so far force will save that came
back into chrome and refresh and now we can see that they’re all left aligned
in their own column and it’s a pretty good start now let’s go ahead and give
these lists items a border so welcomed into the same ListItem rule that
we’ve been working with and we’re gonna give it a left border by creating a
border hyphen left property of 1 pixel solid in white and it looks like save refresh
and there we go so we have these borders on the left but we see that our third
item seems to have disappeared will then disappear just jumped down here
because remember when you’re creating a box any kind of box of content
in CSS that box starts with a certain with when you add padding and borders
and things like that to the item the net with gets larger so suddenly this
33.33% times three which adds up to almost 100% when you add these three borders
to the right edge that’s adding three more pixels and suddenly that’s too
wide for the containing area so there’s a couple of ways we can fix that it’ll
be really difficult if we tried to fix it by changing the width instead we’re
going to change the box sizing property the box sizing property if we set
that to a value of border hyphen box and
that will take that 33% and set that as the final with of that item even after
we add padding and borders and things like that so let’s do that we’re going
to come to this list item rule again and for our next property we’re going
to add box hyphen sizing and set it equal to any value of border hi sandbox
see if that works save it refresh your page and there we go now we have
all three on the same lane again because again that border box and value sets
the width of our items 33%
with that we applied to these items it says that as the final with even after
adding in borders are played now we have a small problem we’ve got three left
borders but we need a border over here as well so what I’m gonna do is apply
or right border to this last list item we were going to do that is we’re going
to create a new rule for the feature list class and this is gonna be identical
to the rule we just created with one exception we’re going to add something
to it Li
Poland last hyphen child that will take the very last list item of that unordered
list and we can set certain properties for just that last item in here
we’re gonna said border hyphen right to a value of 1 pixel solid and white
would save them and refresh and doesn’t look like it applied that lets go
back to her CSS everything looks fine they’re sometimes when you have a problem
like this what I like to do is play around with other items like the text
so we can come over here and said our text color to read and see if that works
for fresh and they didn’t work so let’s let’s point to the anchor tag within
that last
I don’t get rid of that border and center color to read here save it fresh and
it’s not working either so it’s not targeting this last child and a sitcom in
Z a few times get back to the point where we had that border in place and let’s
come to this last child here and inspect the element right click on it and
click to inspect and if we go to that list item itself we can come over here
and we can see a border left applied to it but if we scroll down we see
it’s not applying that border right anywhere we can come over here saver
file refresh and then highlight that I know McGinn we can see a border left
here but for some reason that item is not being targeted we don’t see the border
right property so let’s jump back into our file and we might have a problem
with the index HTML file itself and yet sure enough I see it we have our opening
unordered list tank here this should be a closing an ordered list I guess
that’s an opening tag so forgive me for that mistake let’s go ahead and savor
file and then try to refresh your page and that’s still not working let’s come
back over here we need to get rid of that anchor tag so it’s just Li column
last child and now that rule should work refresh area of now we have that
final border in place so now let’s go back into our CSS and let’s get our text
looking right to go back into her page we can see our texts is great and I want
it to be white and I don’t want to have an underlying sales go back over here and
let’s point to feature hyphen lists face Li space a and let’s set the color to
white and will set the text decoration to none and refresh and that doesn’t
get your text where we wanted our texts still isn’t white but the text decoration
has gone and remember if we go back to index HTML sometimes it just requires
us to be a little bit more specific we have this anchor tag and we’re
trying to set the color for that two white but we have another level of nesting
here we have the h3 tag inside that so instead of setting the color for the
anchor tag to white let’s set it for this feature title class so we’ll go back
into our CSS will get rid of this color white I’m gonna cut that based in just
a second to skip couple lines and will create a role for feature hyphen title
which is that h3 that contains that text and will pace colorway there save
it and refresh and there we go we just had to get a little bit more specific
you know it’s and it this text a little bit let’s get it looking a little
bit better first
of all I’m gonna set its opacity 0.5% that and refresh and now it’s semi transparent
looks pretty cool and we’ll come back over here and said a few more properties
let’s change the font size here 220 pixels to make it a little bit closer
to the sides were looking for an asset fought wait to normal so it’s not as
blocky as it currently looks and see how it looks a bit refresh and looks better
now I want to center aligned everything they’re so let’s go let’s do that
for the list item itself so for this list item we set the width and inside
that list item I’m gonna set text online to center save it and refresh there
we go then we’ll come back to a little more space between the text and the
icon so I’m gonna come back to her feature title here and let’s set the top margin
so margin hikes and topple make it just five pixels not very much and that
should take care of that save
it refresh again a little more breathing room between the icon in the tax
then I’m gonna put a hundred pixels of padding on the top of our list items so
we’ll go back to the list item rule here and we’ll set padding hyphen top to 100
pixels and that should know all of our text and icons down and it looks good
so then I want to do one more thing whenever we hover over this text I wanted
to brighten up a little bit so we’re gonna take away the opacity that we
applied to it whenever we created the initial feature title role here so we’re gonna
point to future hyphen list space Li space a colon hover so the Harvard pseudo
class of the anchor tag there and we’re going to point to the future title incited
feature hyphen title so when we hover over that anchor tag which includes
the icon or the text the future title within it we’re going to set its opacity
back to one save it refresh and now we have a rumor that we see the text brightens
up it’s just a nice little subtle effect and i like it so there’s our
feature section with just a little bit and CSS we’re able to make this look really
nice so thank you for watching and I’ll see you in the next video
PSD to HTML 3.10) Styling the Feature Section
Reviewed by Tayyab Saqlain Zakki
on
23:53
Rating:
Reviewed by Tayyab Saqlain Zakki
on
23:53
Rating:

No comments: