dir.by  
  Search  
Programming, development, testing
Bootstrap - buttons, menus, dialog, slider ... Containers for placing elements
class="mr-auto" move to the right edge , class="ml-auto" move to the left edge | Bootstrap 4.0
  Looked at 5094 times    
 class="mr-auto" class="ml-auto" in the Bootstrap 4.0 
last updated: 10 January 2019
class="mr-auto" move elements to the right edge
class="ml-auto" move elements to the left edge
Example 1 mr-auto
Source code
  Html  
<html>

<!-- title -->
<head>
<meta charset="utf-8">
<title>Example</title>
</head>

<body>
     <!-- connect library jQuery -->
     <script src="https://dir.by/example_lib/jquery/jquery-3.3.1.min.js"></script>

     <!-- connect library Bootstrap (js file) -->
     <script src="https://dir.by/example_lib/bootstrap-4.1.3/js/bootstrap.min.js"></script>
    
     <!-- connect library Bootstrap (css file) -->
     <link rel="stylesheet" href="https://dir.by/example_lib/bootstrap-4.1.3/css/bootstrap.min.css">

     <!-- HTML Elements -->
     <div class="d-flex bg-secondary">
          <div class="p-2 mr-auto bg-info">Flex item 1</div>
          <div class="p-2 bg-warning">Flex item 2</div>
          <div class="p-2 bg-primary">Flex item 3</div>
     </div>

</body>
</html>
Example 2 ml-auto
Source code
  Html  
<html>

<!-- title -->
<head>
<meta charset="utf-8">
<title>Example</title>
</head>

<body>
     <!-- connect library jQuery -->
     <script src="https://dir.by/example_lib/jquery/jquery-3.3.1.min.js"></script>

     <!-- connect library Bootstrap (js file) -->
     <script src="https://dir.by/example_lib/bootstrap-4.1.3/js/bootstrap.min.js"></script>
    
     <!-- connect library Bootstrap (css file) -->
     <link rel="stylesheet" href="https://dir.by/example_lib/bootstrap-4.1.3/css/bootstrap.min.css">

     <!-- HTML Elements -->
     <div class="d-flex bg-secondary">
          <div class="p-2 bg-info">Flex item 1</div>
          <div class="p-2 bg-warning">Flex item 2</div>
          <div class="p-2 ml-auto bg-primary">Flex item 3</div>
     </div>

</body>
</html>
 
← Previous topic
class="navbar-expand-lg" disappears if the area size is smaller lg | Bootstrap 4.0
 
Next topic →
Vertical indentation, horizontal indentation | Bootstrap 4.0
 
Your feedback ... Comments ...
   
Your Name
Your comment (www links can only be added by a logged-in user)

  Объявления  
  Объявления  
 
What the Bootstrap?
Bootstrap where to download and how to connect?
Containers in the Bootstrap ("container-fluid" and "container")
Bootstrap Version 4.0
Bootstrap 4 difference from Bootstrap 3
Elements
"Navbar" in the Bootstrap 4.0 - this is the main horizontal menu for the site (navigation headers)
Styles
class="form-inline" items on a single line | Bootstrap 4.0
class="navbar-expand-lg" disappears if the area size is smaller lg | Bootstrap 4.0
class="mr-auto" move to the right edge , class="ml-auto" move to the left edge | Bootstrap 4.0
Vertical indentation, horizontal indentation | Bootstrap 4.0
to study
WEB Sites to explore Bootstrap 4.0
Bootstrap items for the version 3 and 4
Create a grid "col-md-number" in the Bootstrap 3 and Bootstrap 4
WWW sites for learning Bootstrap
Sites to explore Bootstrap

  Ваши вопросы присылайте по почте: info@dir.by  
Яндекс.Метрика