Spacing between Ivs overlaps

Asked

Viewed 250 times

1

I have this site containing a slider the problem that is happening is that depending on the size of the screen the spacing between each slide changes, someone has some idea of how to solve this?

I’m using the plugin bxslider. The right was to have a spacing of 14px, even defining and everything, depending on the resolution changes, for example in the resolution 1920x1080 It’s okay, but if you change the resolution it’s a problem.

How to proceed?

  • You should specify better what "spacing" you’re talking about, but I deduced two things that might be giving problem, if I’m wrong, edit your question stating the desired spacing

2 answers

1

Create your responsive slide, it’s much simpler and avoids too much headache.

/* Desktop maiores */
@media (min-width: 1200px) { ... }

/* tables em formato porta retrato até os desktos no formato paisagem */
@media (min-width: 768px) and (max-width: 979px) { ... }

/* dispositivo em paisagem até os tablets em formato porta-retrato */
@media (max-width: 767px) { ... }

/* dispositivo no formato paisagem e abaixos */
@media (max-width: 480px) { ... }

So you can reach a much larger audience and solve your problem, in case you don’t understand in place of ... you put your css using max-width as a base in the resolution.

  • 1

    Although this is not the solution to the problem, but a good recommendation, it would be even better if it were "mobile first", more or less like this: make the site as if it were for a mobile phone, adapt it to work on larger screens. From the example, try to take out all the max-width (more information: http://www.html5rocks.com/en/mobile/responsivedesign/).

0

I believe the spacing you’re talking about is the property padding CSS, so with this CSS code, you will have the correct spacing, however the correct would be to learn how to make the change directly in your plugin, you should look for the documentation of such bxslider and read to learn how to use it properly.

If it is not this property that solves your problem, please explain in more detail what "spacing" you are talking about.

But I am deducing that it is one of the two codes below that solve your problem:

.slide_txt {
    padding-left: 14px !important;
}

Or would this be it:

.bxslider li {
  margin-right: 14px !important;
}

The selector !important causes all other definitions of the same element and same property to be ignored and makes this the most important.

  • Would it be about slide_txt? would be the spacing type between a li, the slide_txt would be the text part inside. So bxslider has a property for it slideMargin Margin between each slide

  • then the correct one would be this second code that I posted in my last edition see

  • even so it seems that does not give, strange that the plugin changes the size of li, I think this is the point that is giving problem, I will try to find the part that changes to fix

  • But there is no way the plugin or nothing changes a CSS property applied to an element so directly using a !important so this margin-right that I provided you will always work, but it may be happening in some cases the plugin is using margin-left, you have to show me better which problem you’re going through?

  • Style of the LI in 1280 float: left; list-style: None; position: relative; width: 668.5px; margin-right: 14px; in 1440 float: left; list-style: None; position: relative; width: 666.5px; margin-right: 14px; In case something of the plugin is changing the size of each slide, depending on the screen size can reach 500px, I think it changes after updating the page

  • Well, this is a natural slider action, after all the lower the resolution the lower your preview will be, however, you can apply a standard size to all resolutions or an adjustable value that would be in % which would be better for you?

  • Well, I commented on the 224 line of the slider [slider.children.css('width', getSlideWidth());] and it worked, I’m kind of in tight delivery, but give anything I use media-queries to adjust in resolutions smaller than 912px. Thanks for the help, man

  • Okay, thanks for helping, if you want a better solution, just let me know.

  • It would be cool, I tried to follow the documentation specifying the size of the slide (slideWidth ) and the margin (slideMargin), but it made a difference. The problem I’ve caught now testing here is Internet Explorer 9, but then it must be something else that’s making that difference

  • try to use a <div> that encompasses all slides you have set in css the size, and your <li>'which are the slides, you can divide into 3 or 2, for 3 would be: width: 33.333% and height: 100%; each, and for 2 would be: width: 50% and height: 100% each.

Show 5 more comments

Browser other questions tagged

You are not signed in. Login or sign up in order to post.