Digital experiences for all disciplines
New Landing › How can we help? › Themeforest Theme Support › Joyn › Change column width from 1/4 to 1/6 using @media
New Landing › How can we help? › Themeforest Theme Support › Joyn › Change column width from 1/4 to 1/6 using @media
- This topic has 16 replies, 3 voices, and was last updated 8 years by Rui Guerreiro – SUPPORT.
-
Posted in: Joyn
-
November 5, 2015 at 5:54 pm #226334
Is it possible to change the col width from 1/4 to 1/6 using the @media css?
November 5, 2015 at 6:03 pm #226349Sure, you simply target the bootstrap column class and adjust the percentage.
Four 1/4 columns to 1/6 would look like this:
@media (min-width: 768px){ .col-sm-3 { width: 16.66666667%!important; } }
That is a basic example, you would want to target more specific selectors
.my-custom-class .col-sm-3
so you do not alter the whole site layout.-David.
November 5, 2015 at 6:28 pm #226364It sizes them properly but still only keeps 4 columns per row
Attachments:
You must be logged in to view attached files.November 5, 2015 at 6:37 pm #226373That’s because there is only 4 items per row and each row will start a new row of 4 items.
You will need to drag your columns into the Row in the page editor.
– David.
November 5, 2015 at 6:52 pm #226383like this?
Attachments:
You must be logged in to view attached files.November 5, 2015 at 6:56 pm #226386Just by visually looking at it, I’d say that would be more likely to work. Have you published this or better yet, set up a test page?
-David.
November 5, 2015 at 7:00 pm #226390What I want is for each row to show a certain number of tiles based on screen width. I understand using percentage. But I can’t override the THEMEs bootstrap sizing for each row.
For instance
if I make a series of tiles like this
[1/4][1/6][1/6][1/6][1/4] I get 5 tiles and using css I can make them all 20%
what I want is for the tiles to display at 20 then the screen is 900px or more so you get 5 tiles
700-900 3 tiles so each column is 33%November 5, 2015 at 7:01 pm #226391http://test.overdrivedesign.com/structure/
@media only screen and (min-width:960px) {
/* styles for browsers larger than 960px; */
.main_menu_row .col-sm-3 {
width: 20%!important;
}
} with the codeNovember 6, 2015 at 3:01 pm #226677Hi,
You can do that with the code I posted above.
You just need to change the percentage values for the width and match the column class
.col-sm-3
with what is being used on your page.So, given you example for 5 tiles for that media query you use this:
@media only screen and (min-width:960px) { .spb-column-container.col-sm-3 { width: 20%!important; } }
This however will not work if you have less than 5 tiles within the parent row. Each Row will make a new line.
Thanks,
David.November 9, 2015 at 7:18 pm #227216I can get the widths to change accordingly, but the number of tiles per row do not change I must not be understanding your instructions.
November 9, 2015 at 7:22 pm #227218What is your login, I’d need to see how the page content is setup.
If all items are in one Row, the items per row will change depending on how many times the item width is divisible by 100% of the width.
Thanks,
David.November 9, 2015 at 7:49 pm #227226Its working. I’ll post the code if you want it.
-M
November 9, 2015 at 7:49 pm #227227thank you
November 9, 2015 at 9:04 pm #227243Spoke too soon. Not working. Having six columns per row seems to be throwing it off. It will change the percentage width accordingly, but then leave blank spaces. This only occurs when there are rows of 5 and 6.
November 9, 2015 at 9:04 pm #227244This reply has been marked as private. -
Posted in: Joyn
You must be logged in and have valid license to reply to this topic.