PSD to HTML 4.3) Responsive Portfolio Items
Previous: PSD to HTML 4.2) Our First Media Query
Transcription of PSD to HTML 4.3) Responsive Portfolio Items
hello and welcome back to the PSD to HTML responsive
portfolio build in thislesson
we’ve we’ve already we resizer browser we’ve already taking care of some
of the issues for when we first get our browser under 900 pixels we’ve added some
padding their the next area I want to tackle is our portfolio section down here
because once we get under 900 pixels it is doesn’t look good I don’t like
having this one extra portfolio item down here by itself so we’re going to
add some more to that particular media query we reach 899 pixels and less and
I want to edit this portfolio list at that size so we go ahead and change this
we’ve moved everything into a new folder here to the site 21 folder so it’s
going to change that and if things should still look the same here and let’s
edit the rules for war that portfolio list whenever we get down to that
side so let’s jump into our file here and let’s skip a couple lines underneath
the feature list but still inside the curly brackets for that 899
media query and let’s create a rule for the portfolio list which is the unordered
list that contains those four columns with our portfolio pieces so first
of all and one that list to take up 100% of the width of the browser so she
goin said with their two hundred percent not just under the symbol itself so
we’ll save that and refresh and we don’t really see any big difference yet but
we’ll get there so there’s a portfolio with and now for the list items
themselves I want them to only take up 20% of the total with I’m sorry 25%
there’s four of them so a hundred metaphors 25% so will point to the list items
inside portfolio hyphen list so portfolio this space Li and for those lists
items I want to set the wit to 25% or again one-fourth
of the total it I’m also going to take away the padding said patting
2012 margins 20 right now it has some margins facing in between the islands
were gonna bring them all together and center margin 20 and then in
tests that saying that refresh your browser and they were given out as we resize
it we can see those items getting narrower didn’t look too bad but once we get
to a certain point we’re gonna want to break them up even more but that’s a good
start at least its not breaking as soon as we get below that that 900 pixels
the next thing I want to do is to change the size of the captions you’ll notice
when we get to a smaller size are captions are doing some weird things at this
point right here caption
isn’t even reaching all the way to the edge of that column and when we get
to a smaller size you’ll see that RI concert getting covered up so right now are
captions are set to a specific with and pixels so once we get below that 900 pixel
mark I want to change that so that the caption is 100% of the width of the parent
element so we’re gonna come back to our CSS here and those captions are contained
inside a span tags so we can point you . portfolio hi friend list and if
we scroll up we can see the portfolio list section above the folder and here’s the
original rule for that portfolio list Li span so that’s what we’re targeting
here that’s going to copy that rule come back down to the bottom and we can
piece that here and again those spans contain the captions and here we’re
gonna set the width for those captions to 100% so if we say that you’ll
notice again at this size we have that gap here so it’s refreshing and there
we go now receded that expands excuse me the entire width of the column and
as we resize it down it still looks pretty good so again once we get to a certain
point we’re going to have to break it up a little bit more before now it’s
already looking better now one problem you might encounter whenever you’re
trying to create these media queries is sometimes you don’t really know
how wide your browser is at a certain point when things start to break well
we can test that by turning on our web developer tools and you can find that
in chrome by going to the View menu down
to developer and developer tools you click on that and it opens up a window
down here at the bottom and it’s the same window you see whenever you right
click on an element to inspect it but when this opens up you’ll notice that
when you serve resides in your browser appear
in the top right you can see the dimensions of your browser so you can see
as we get smaller that at about 640 pixels things start to break so maybe at 640
pixels we want to create our next break point to enter code we might go ahead
and come to the end of this particular media queries skip a couple lines
and create a new media query so we’ll say media and then inside parentheses
will set max which choose 640 pixels now keep in mind that this particular
media query won’t cancel everything inside this media query it will
only cancel these rules up here if there’s something inside this media query
that conflicts with those rules otherwise it’s gonna leave these alone this
portfolio list will still stay at a width of 100 pixels even when we get below
640 pixels unless we specifically change that inside this second media query
but since we’re dealing with our portfolio list right now let’s go ahead and
finish that up inside this media queries other things we’re gonna do inside
it as well but for now it’s focusing on this portfolio list which contains
are for items so at this point it’s starting to get really cluttered so let’s
just break these all up so that they’re all on their own line
right now they’re all floating to the left so to fix that we just set the float
property back to none so we’ll go inside that media query we’re gonna point
to dot portfolio hyphen list space Li were pointing to the list items inside
that portfolio list and will said the food property equal to none and will set
the width for each of those lists items to 100% so they each take up the entire
width of the browser’s let’s save that and refresh and see how it looks and
already looks pretty good so as we resize it once we get to that break point
things are no longer breaking things are starting to look pretty good and
it looks nice so we can do more here with a jump back into our CSS for that for
those lists items and we can put a little spacing in between those lists items
there’s a little bit of space in between the first one in the second one so
we can do that just by adding some margin hyphen bottom and we’ll set that you
may be 10 pixels and that refresh and know we have a little bit of spacing in
between those items and that looks really nice and we can take that all the way
down to small as the Browser lets us go and it still looks really sharp so now
that we’ve gotten that taking care of you can scroll back up to the top and start
to take care of our menus or menu starts to break at a certain point as well
so we’re gonna start in the next video fixing up our menu to work like we wanted
to say thank you for watching and I’ll see you then
PSD to HTML 4.3) Responsive Portfolio Items
Reviewed by Tayyab Saqlain Zakki
on
00:01
Rating:
Reviewed by Tayyab Saqlain Zakki
on
00:01
Rating:

No comments: