My Web Dev

Interactive flashcards for learning vocabulary

Englishhardby MaximNova2
Flashcards: 2004.2 / 5

Save words from this page and practise them with flashcards in DuoCards. How does it work?

Does that make sense?
How to create a complex grid-looking gallery.
And of course this entire thing is completely responsive.
So let's make it a bit smaller maybe.
We have this one-column layout, basically, with everything in a mobile view.
You feel great about yourself once you finished it and show potential clients that you build this here with the new grid technology.
I already have the starter files here on the desktop.
We actually have a lot of images this time
You see that the architecture here is also slightly different than what we had in the last project.
I'm gonna go deeper into why I did it this way a bit later.
What matters for now is that we're gonna start with the base file.
Where we have the Google fonts already included.
Of course, the styles are already included, the favicon, the title is already here.
And finally, also, the package json file.
If everything works, let's start by creating our global settings.
We're then gonna inherit that from the HTML.
Now another thing that we do here is to set our overall font size.
Let me actually write it down here for you, once again.
Actually I already have a variable here so we set it to font primary.
I chose gold color for this brand because it's luxury homes.
Then the secondary color is like this very dark blue, which plays very well with gold.
It looks like everything worked just fine.
We can do one small change here in the live server.
It will basically launch our default browser.
We have the final version here on this site.
We are gonna be building the overall layout of our website.
You're gonna learn how to build a complex and modern layout using advanced techniques.
We start by analyzing the overall layout that we want to build.
So the first thing that you notice right away is this sidebar here on the left side.
This is another part of the layout.
Basically describing how the company works.
This basically is like a testimonial of some people who found their perfect home.
This here is one part of the layout, which is like the gallery, like the pictures.
Then, next up, we have the story, remember?
We know that these two are part of the story blog, but there's not really an element for that.
That's our markup structure.
Let's take a look at that if it's already in our page.
Let's now go ahead and actually give each of them here a background color.
We're gonna build these selectors, like we've been doing throughout all the other projects.
It's just so that we can see the boxes a bit better.
Give it a save and close, and this one, we can close, as well.
I could've done it directly in the body here, of course, but I think it's a bit more cleaner to actually use this container class.
Let's take a look now at our final design again.
If I decreased this here, then you will see that the height of the container adapts as well.
Right now, we have an explicit Grid with only one row.
We're gonna change that in a second.
Actually, let's go back here and take a look at the second row.
It really doesn't matter, because, either way, it's gonna mean that there will be enough space to fit all the content.
Units like viewport height or viewport width are really important units to use in a real-world scenario like this one here.
Instead of writing it out three times, let's simply use the repeat function.
So I hope that makes sense, and if it doesn't, then just try to imagine that we put fixed pixel values here in all of these rows.
Imagine what would happen if users viewed the page from a phone or from a tablet.
It's very common in web design to use a design grid.
As I mentioned, grid systems like this one are widely used in web design.
Now it may not really be necessary for this design.
I think this would be reasonable.
The minimum size that it should have in order to fit the content in there.
The last step is to actually, basically center these columns.
What do you think would be the best way to achieve exactly that?
We have the one that occupied the remaining space.
Now if we hadn't this sidebar here, then you could've used the margin.
Remember that the grid line can have multiple names.
Now before all of this starts confusing you, let's actually use this in practice right now.
So let's continue, and maybe you're wondering why we are not naming the rows.
In that case, you only really need to define the columns, because the columns are always more important
We also have the header, and the top three realtors, but let's leave them for a bit later.
Because these are not as straight-forward as the others.
Let's actually now continue with the gallery and the footer.
The gallery spans all the way from the sidebar here to the end, and as well as the footer.
This is just here for development purposes, so I'm gonna change that here in a second.
I'm gonna delete this later, this is just so we can see a bit better what's going on here.
Now as for the homes, we actually want them to be the same as the features.
So we defined the homes, features, gallery, footer, and sidebar.
Next up let's think about the header and the realtors.
That is why these columns that we have here in the middle are so useful.
Because they allow us to build different kind of designs.
Just to make sure that you understand why this works.
So with this, we finished our overall layout, actually.
It's really simple to create a complex layout like this.
I think this is really rather complex.
I tried to do something not all too weird, but at the same time to go into some complexity.
Watch what happens as we really approach the width of these columns.
We actually don't want it to be quite like that.
They are the ones who will start shrinking.
And actually we cannot inspect it really.
Instead let's do it like this.
And so as we now decrease the viewport, the columns will start to shrink.
I build this layout here step by step.
It's really important that before moving forward, you are 100% sure you know what we did here.
They might not really apply to your own particular design.
But enough talking, let's move on to the next step.
Gonna learn how to create a responsive component without media queries.
And then finally, we will build even a very small component.
We just have to use the curly bracket.
We're just gonna manually create our grid.
Because that's just what's gonna happen anyway if you don't define anything at all.
So all of our items will basically be placed in an implicit grid, and not in an explicit grid.
That's not a problem at all, it works just the same.
And we can also see that here in the dev tools, quite well.
And you see that the line here is dotted.
That means that these are row tracks of an implicit grid.
Now the next step is to actually get rid of this huge font size here.
And I'm gonna put it here before the grid stuff definition.
Now we're ready to start filling this up with the actual content.
Icon sprite that I already included in our image folder.
Right now you already know how to do that.
You see that it has this different font size than this one here.
Remember how we did that?
And then in here we have the different icons, and this one is called icon-global.
I'm not gonna do that because I really just wanna quickly get my content into here.
This is like a component that I'm gonna reuse throughout the page later on.
That's not really part of the feature block here, and the feature component itself.
World's best luxury homes.
Of course we're gonna take care of that later.
For now, let's actually just copy this here five times.
This was just for testing purposes.
I think one is missing, yeah.
Of course we could leave the same text here for all of these elements.
It would look weird and not natural at all.
We have different amount of text here.
After we're done doing that, we will then lay them out here in this way.
These two, one after the other.
This feature component here would, in theory, be reusable in another page.
I still put them in the same file though because they are closely related.
Having these classes in different files would make me jump around a lot through the different files.
That would be terrible for recording videos like this.
Basically each of the section now got its own file.
This feature here would be completely reusable somewhere else later on the page.
What we have to do is to use the fill property, and then we use the primary color.
Now finally, we also want to style the heading.
That's the one that we're gonna use for all of the headings.
We can do like this placeholder that I showed you a long time ago, I think.
Now all I have to do is to extend all of these like this.
We want to use this heading in different situations throughout the page.
That's actually do that with a modifier class.
That already looks quite good.
Now all we have to do is to actually align these elements like we have it here.
We are going to use grid here. Because why not?
We have the row axis and the column axis. It's really a two-dimensional.
But instead of doing that, we will simply put auto.
Because this way, if we eventually wanted to change the width here of the icon.
Then automatically the width of this column would adjust without us having to change anything.
Probably you start to see this emerging as a trend.
In a real world scenario, that's actually many times the case.
We will have other cases where we will define the rows.
You're gonna see that later.
Let's check out what's happening here.
The third one, because of the auto-placement algorithm, gets placed here under this icon.
We're sure that it goes all the way until the end.
This would be the last explicit grid line.
This minus one here doesn't make much sense.
Again, the minus one only works with an explicit grid, but we had an implicit grid.
It doesn't really highlight here the spanning going on, but it doesn't matter because we can see it by ourselves.
Actually I think if you hover it here, then you will see it.
Not really, but again, that's not a huge problem.
What we need now is of course some spacing here.
Just a couple of things that we need to change here.
That's just something that we have to do manually.
That should fix that.
That looks a bit more natural now.
Our second issue is that you see in these two columns that the space here is huge.
Now it's centered but that's still not what we want.
You can use them to your advantage to achieve exactly what you need to achieve.
Welcome back to building or project.
And then we also want the text to be uppercase.
We want it to be transformed to uppercase.
Let me just add a button class here.
Right now I'm being a bit lazy here for that, but it's no problem.
If you have a bigger project, then of course you cannot do it like this.
I know that maybe it's a bit confusing for you to now use Flexbox all together here with Grid.
That's just so that you know that this is how it works in the real world.
It would have been even easier than this.
Now the same thing here happens as we had before.
How do we stop them from doing that, and instead put them here just all the way to the start.
It's also good to see that we can use these two different technologies to achieve the exact same thing.
You can go with whatever makes more sense to you.
We could do this in many many different ways.
Now another thing that I just noticed when I was resizing this page here, is that at some point there's not enough space here.
I choose to just do it like this.
And it's actually an amazing unit. It's really helpful for this kind of stuff.
And you see that also it already happened up here.
We could use a transform and simply scale it up a little bit.
Unless we then also define the transform origin but that's a bit too much I believe.
Why can we now not see it? Well it's just because of the z-index.
We have to assign it a bigger z-index. Let's just use something big.
And indeed now it is on top.
Now let's just add a couple of shadows here.
Because this one here is actually overlapping this lighter area.
It looks a bit out of place.
In order to make it fit better into the overlook and color scheme of our page.
So for that we just use the linear gradient trick.
Of course I could've had use absolute positioning to position these images.
We can see if our code is working correctly.
That's because I keep forgetting to set the display property.
We have like button here, which is basically so that the user can click this, and then put it on the wish list.
Because it's rather difficult to write it all out.
All of this looks rather strange. That's because we didn't format anything at all.
Let's now just confirm if everything is okay.
So, then you don't have to waste time doing all of this.
And, alright, it's already doing what it's supposed to do.

Learning with DuoCards

What is DuoCards?

DuoCards is a language-learning app that helps you build vocabulary with flashcards. You can save words you want to learn and practise them over time.

How do I learn with this set?

Browse the flashcards to see the words and their translations. Select Card picker and choose the words you want to learn. Then create a free account to save your words and practise them.

How do I practise my words?

You'll see a flashcard with a word and a hidden translation. Guess what it means, then tap to check your answer. DuoCards repeats the words you find difficult.

Do I need an account, and is learning free?

You can browse this page without an account. A free account lets you save words and track your progress. The free plan has limits, and Premium offers additional features.