Container and sidebar at right side - css

I am trying to achieve something, I want a main container and a sidebar at the rightside. which should deal with mobile layout as well, I was unable to find such thing or make it. The blue print is given in the image below. Thanks
BluePtint of what im trying to make

You can create this layout using div's with different ids or classes- your main body(red) could go in a div with class "#mainbody" and your sidebar(blue) would go in another div with class "#sidebar", then you can specify the dimensions in CSS.
Have you checked out a CSS framework like Bootstrap? Bootstrap makes it super easy to specify column widths with their grid system, so instead of having to state px or % width in CSS, you can add the class "col-md-3" to a column for a width of "3". Their system is based on units of 12, where 12 would be a full bar, 6 would be half etc: https://getbootstrap.com/docs/4.0/layout/grid/

Related

Show image in Square grid (React + Material UI Grid)

I use React + [Material UI Grid][1] to show my images, the images are in different sizes, and I want to:
Keep image ratio
Make image fit the parent container square(in other words, all images in a row with the same height)
The problem is that, The number of columns in Grid is variant, sometimes 3 columns(on mobile) and sometime 6 columns(on PC), React calcuate the width of image Dynamically. I don't know the run-time image width, so i can not set the image height in my css style excatly. any idea? thanks.
You can see the following effect currently, a very tall image makes the grid streched vertically, very ugly.
Use this code. It centres the image inside the Grid and doesn't let it overflow while also not giving the dim in pixels. Although the dimension is fixed to square(a x a) but can be changed.
I had the same issue in the past so I am sharing my own code.
Hope this will be useful as I have used CardMedia with component type img. You can select the relevant CSS if not complete from inspecting.

How build css for custom layout?

I want to reproduce Google's spreadsheet behaviour with frozen first row and first col, in htmlm with little additions. This is done inside a web browser, so it's a site, page or web app (written in React, if that even matters, cuz question is mostly about css). Lets start with layout:
Availble view space of the page is separated in 3 distinct areas:
100% width, variable height Header, attached to top
Main View, occupying space between header and footer
100% width, variable height Footer, attached to bottom
Main View is then gonna to be split into two sections:
Menu of variable width, attached to the left-side
Table view, occupying remaining width
And Table view should have following properties:
Table area is scrollable, except
First row, where table headers must remain always visible
First column, where order No # of item must be always visible
I am stucked of a good and straightforward implementation. I gave up using <table> because it has no power to implement it, so clever <div> handling most probably would do the trick.
My question is How to write css for that layout? Lets omit layout html/jsx, I think its obvious. What css structure and classes would you suggest to me for this particular task?

ionic 3 tabs width to avoid entire horizontal space

i am using ionic-tabs component and trying to make the tab bar width just enough to show contents rather taking the entire space.
I don't see a sass variable to control it. all the variables are to control text and color related items.
How can i set the max height and widht for the ion-tabs ?
What I am aiming to look them like
https://www.dropbox.com/s/vv9vjjk2ym3iacb/Screenshot%202017-10-23%2014.10.27.png?dl=0
instead of
https://www.dropbox.com/s/hj1s1tp3xd8wbub/Screenshot%202017-10-23%2014.11.00.png?dl=0

Bootstrap 3 fixed size template

I want to create fixed szie page, without common scrollbar. Scrollbars have only two div's, where content content goes beyond of div (contend data and sidebar listing area) as on picture. I alreay did it without bs3, and use javascript (for calculate new offsets on page resize).
http://i.imgur.com/4kesDk7.jpg
Today I tried to create fixed size template with Bootrstrap3, but i can't do it. It's possible to do using bs3? Anybody can show how it is done?
I tried modify this code http://www.bootply.com/0FG70wcT3B. I do left and right headers.

Image does not horizontally line up with the text above and below it with 960 grid

Any idea why my image does not horizontally line up with the text above and below it please?
http://dl.dropbox.com/u/2306276/site/index.html
You're using a different class for the image element than for the text elements you want on the right column. Set the image's class to grid_13 (same as the text) and add push_3, so it moves 3 columns to the right.
It'd be better to rearrange your elements into divs though; otherwise you'll have to give each element specific properties, and that beats the purpose of using a grid system.
In the 960 Grid system, every nested class has to have a "grid_x". You div's in between ("Status" etc) which don't use the grid system, I imagine these are throwing it off.
Try adding grid classes to these, using "alpha" and "omega" where appropriate.

Resources