New Landing How can we help? Themeforest Theme Support Neighborhood addressing custom classes with css in theme options

Viewing 4 posts - 1 through 4 (of 4 total)
  • #195369
    MarieWorks
    Member
    Post count: 225

    Hi,

    I have given two assets on my home page (the regular and mini versions of our staff picks product carousels) custom class names in the page builder.

    I would like to be able to address them in the CSS using @media to define what shows up on what kind of device.
    (we want the mini style of product list to show our ‘staff picks’ on mobiles, but from tablets upward we want the large carousel to be used).

    I think this should all be fairly achievable in CSS – now that these elements have custom diff classes (staffpicksnarrow and staffpickswide) – but I haven’t quite been able to work out how to do it yet…

    Any help would be greatly appreciated.

    Many thanks,

    Chris

    Attachments:
    You must be logged in to view attached files.
    #195577
    David Martin – Support
    Moderator
    Post count: 20834

    Hi,

    Here is a very useful list of all media queries you could use: https://css-tricks.com/snippets/css/media-queries-for-standard-devices/.

    Tablet Example:

    @media (max-width: 979px) and (min-width: 768px) {
       .staffpickswide {
           display: block; /* Show */
       }
       .staffpicksnarrow {
           display: none; /* Hide */
       }
    }

    Thanks.

    #195586
    MarieWorks
    Member
    Post count: 225

    Awesome,

    thanks David – I’ll give these a go.

    C

    #195589
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779

    Nice. Thanks David.
    -Rui

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register