1

I want to move the element within col-sm-4, more towards left side of the window in which it is shown, basically my element is a donut chart which is half shown in mobile view -- however I think If I could adjust within the col-xs-6 element it would be shown proper.

enter image description here

Here's a sample code, can we move the alignment within the col-sm-4 box.?!

<!DOCTYPE html>
<html lang="en">
<head>
  <title>Bootstrap Example</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>

<div class="container-fluid">
  <h1>Hello World!</h1>
  <p>Resize the browser window to see the effect.</p>
  <div class="row">
    <div class="col-sm-4" style="background-color:lavender;">.col-sm-4</div>
    <div class="col-sm-4" style="background-color:lavenderblush;">.col-sm-4</div>
    <div class="col-sm-4" style="background-color:lavender;">.col-sm-4</div>
  </div>
</div>

</body>
</html>
George
  • 6,630
  • 2
  • 29
  • 36
nightfury
  • 384
  • 6
  • 18

2 Answers2

1

add another class... in css

.class1 {
 width:350px !important;
}

in html

<div class="col-sm-4  class1" style="background-color:lavender;">.col-sm-4</div>
  • thanks @patricia but can you help with this question [Question] [http://stackoverflow.com/questions/43977086/d3-donut-chart-not-visible-entirely-when-in-mobile-view?noredirect=1#comment74996369_43977086] – nightfury May 16 '17 at 09:15
0

you can just use col-xs-6 so get 50% with in xs devices

the col breakpoints can be combined:

<div class="container-fluid">
  <h1>Hello World!</h1>
  <p>Resize the browser window to see the effect.</p>
  <div class="row">
    <div class="col-xs-6 col-sm-4" style="background-color:lavender;">.col-sm-4</div>
    <div class="col-xs-6 col-sm-4" style="background-color:lavenderblush;">.col-sm-4</div>
    <div class="col-xs-12" style="background-color:lavender;">.col-sm-4</div>
  </div>
</div>
  • Hi, can you address this one -- I am actually doing the same -- here's my actual detailed question, which didnt got much attention ---> [THIS ONE](http://stackoverflow.com/questions/43977086/d3-donut-chart-not-visible-entirely-when-in-mobile-view?noredirect=1#comment74996369_43977086) <-- – nightfury May 16 '17 at 09:02