Olivia Owen Olivia Owen - 1 year ago 452
HTML Question

Bootstrap Margin Top

Hi first sorry my english. I will try to tell the with image.

I have 2 rows and i want "margin-top:-50px" in the bottom row but distored for mobile and other view.. my code here;

<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<div class="myavatar col-lg-2 col-lg-offset-5 col-md-4 col-md-offset-4 col-sm-4 col-sm-offset-4 col-xs-6 col-xs-offset-3">
<img src="1.png" class="img-responsive">

<div class="row">
<div class="col-lg-4 br">a</div>

See the below given image

enter image description here


Answer Source

Try this code

if (!(navigator.userAgent.match(/Android/i) ||
    navigator.userAgent.match(/webOS/i) ||
    navigator.userAgent.match(/iPhone/i) ||
  )) {
  $(".row").eq(1).css("margin-top", "-50px");

So what i am doing is I am checking whether the browser is mobile or not. And if it's not a mobile view, I am applying the css.

Hope it works for you :)

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download