Having issue in learning CSS Grid and Flex box - css

I am having issues in learning CSS Grid and Flexbox I can not understand the layouts and understand tags. Is there a solution or a way to learn?
Thanks

Don't memorize codes, use what you will learn in practices, search about your questions.
you can write a documentation for yourself, draw divs (for example to see whats the difference between "align" and "justify" values).

Grid:
Grid Layout
The CSS Grid Layout Module offers a grid-based layout system, with rows and columns, making it easier to design web pages without having to use floats and positioning.
For more information try:
https://www.w3schools.com/css/css_grid.asp
Or
https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Grid_Layout
Flexbox:
CSS Flexbox Layout Module
The Flexible Box Layout Module, makes it easier to design flexible responsive layout structure without using float or positioning.
For more information try:
https://www.w3schools.com/css/css3_flexbox.asp
Or
https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Flexible_Box_Layout/Basic_Concepts_of_Flexbox
Hope these help :)

Related

would a css grid framework be a good fit for creating application like layouts?

I have a webapp that I am making and it has some particular layout needs that are closer to an application than a website.
The layout has:
a left sidebar that is fixed to the left side of the browser window and has a static width until it stacks, this sidebar will have tabs in it
a content area that will expand to a certain max-width and then stop
a right side bar that is fixed the the right edge of the content
I've been struggling to really determine if using a grid system, like bootstrap, would be an appropriate fit for something like this. Having some rows/columns and a collapsible grid in the content area seems like it would make sense, but in the sidebars it seems like its best to not use a grid system at all. I don't particularly like the idea doing some layout in the html with bootstrap3 and some in css.
Basically my app has the same layout as http://qz.com/ and I want similar responsive design breaks, and with that I would like to know if there is one or more css frameworks that support that type of layout with little overriding.
if you have some experience with resposive design and media queries, i would code it myself to avoid the thousands of lines of unnecessary code that comes with frameworks/libraries. bootstrap is great, but it also requires a bit of effort to master, and it would be a bit overkill for this one layout (if i understand you correctly).
if you just need this one layout, i would really recommend you do code it from scratch (personally i'd use something like jQuery and LESS). i hope i understood your question correctly, and sorry if this was not very hands-on.
to sum it up: in my opinion you're probably better off coding it yourself, but bootstrap and other frameworks will provide valuable insight and inspiration for how to do it.

Grid layout - why should I use it, and should I use a framework like Bootstrap or Foundation?

I had experience with Twitter Bootstrap and Foundation, and I personally think the only thing I want to use is their grid system. Other features are just bloated.
So I read about the prospect of a grid layout. All of the articles I found are oriented toward an 'artistic' explanation (golden ratio ect). I am a coder at heart, I need a clear & logical reason to use a grid layout (for example: 'columns can be easily stacked on top of each other on mobile screen, and expand horizontally on larger screens'). Can someone give me the pros and cons of applying a grid system to my website? Personally do you think using a grid system is good?
If the answer is yes, should I use a premade grid system like from Twitter Bootstrap/Foundation or just make one for my own? All of the other features are unnecessary for me an irrelevant to my problem.
Thanks! :D
I agree with #kunalbhat that this might not be the best area to ask this but since you did I will try to answer it.
The grids are designed allow for speed and adaptability. Speed in multiple senses. The first part of the speed is the speed of writing the code. You can easily get the layout you want when you are using the grid system and everything aligns correctly. You don't have to remember your tables and columns and col-spans, etc.
The second speed is modifying your code. Inevitably you will need to go back and make changes, with a grid this is easily to do. Changing a col-md-7 to a col-md-6 easily makes a little tweak in the layout of your page that can easily be tracked and performed.
You mentioned responsive design, both Bootstrap and Foundation have responsive grids. The grids will snap to different sizes based on the viewport size. However you have control as well. For example if you want something to take 1/12th the screen in desktop, 1/4th on a tablet, and 100% on a phone that is easily done with Bootstrap and Foundation, both have grid classes that target specific viewports.
The also provide visibility classes based on those viewports.
For the "bloated" part that is easily solved. Using SCSS you can easily only import portions of a library. For example for one project I was on I only imported the Grid and it was considerably smaller.
I happen to think that this is a SO question, simply because of one of the main cons of CSS grid systems: semantic.
I think semantic is important for a web developer and having a class named col-md-7 is not the most semantic thing to do.
But I like grids, because they are easy and quick to use, so I started to use LESS. Because it allows me to use variables and functions(mixins) in CSS, I can build my own grid system on my CSS rather then on my HTLM.
You can start on Frameless and customize your own 'classes'.

CSS Layout Issue with 960 GS

I am just trying to achieve the following CSS layout using 960 GS. Pretty much an newspaper article kind of layout. I am finding some problem with positioning.
I am using for your kind info
$ninesixty-grid-width: 978px;
$ninesixty-columns:12;
$ninesixty-gutter-width: 0px;
$ninesixty-class-separator: "-";
I could not achieve the newspaper kind of layout with the image inside the text. Please guide me out some links or pointers or code to achieve this. Let me know if you need futher info
You didn't say if you already had the grid or not, but anyway if you go to - grid generator site and enter the settings:
Firstly wrap the whole page in a container-12 then I would use the following classes on your divs for the layout:
NOTE:
I think you will need to put both elements in the first grid-6 to avoid a float issue. Other things to consider is that you don't have a gutter so elements will be tight up to each other. I would suggest amending the settings and adding a gutter.
Usually I would not add padding to the grid elements as that means you would need to edit the widths and that goes against the grid system.

UI Design: Popular Site Layout Grid Systems > 960

I am familiar with the popular 960 Grid System setup and it's been very helpful - but I am looking for other popular/heavily-adopted solutions with the following abilities:
Larger base resolution (1280px rather than 1024px)?
Makes use of HTML5 semantic layout tags: ASIDE, NAV, etc.
Clean CSS: few "tricks/quirks" as possible... CSS3 would be a bonus.
Thank you.
Twitter Bootstrap features a grid system as well. It is kind of based on the 960 one but you can also modify it to roll your own. And it has a bunch of other shiny features (including HTML 5 and CSS 3).
Not sure if many people are still using the 960px layout since many people are into responsive design now. Check out html5boilerplate, tutorial from tutsplus(html5/css3 starter), cssgrid, fluid base grid(targets any resolution). Not sure if those helped but should give you an idea. I would go with fluid or used one of these as a boilerplate for new projects.

Overlapping grids in 960 Grid System

For example, in a 12-column grid, I want to have a 9-grid-wide and another 4-grid-wide . The divs will have an overlap 1 grid wide in the middle. This is useful for some fancy effects.
Of course I can just use one div and then create more divs inside accordingly (not using the Grid System), but is there a better way?
Or you could organize your layout by yourself with all custom DIVs, that just follows the guidelines the 960GS gives you. There's nothing that tells you that you have to use the premade HTML template to benefit from the concept of the grid system. It's just there as a guide to make sure all widths on the page look good and fit together.
I believe that grid CSS systems were designed to enable quick and easy table-less layouts. They were not designed for this kind of thing. However, there is a third party tool that may interest you. You can find it here: http://gridder.andreehansson.se/
You may however find it easier to just use CSS to layout your DIV elements, overlap them using negative margins and use the z-index property to determine which of the overlapped DIV elements should be on top.

Resources