Search code examples
androidionic-frameworkionic3

How to create layout type components in Ionic Framework


I wanted to create a layout with background color orange and place one image and text in the left and right gravity in that layout. In native, I can create a linear layout and achieve the above requirements. But how to create a layout type component with background color and insert image in text into that component in Ionic Framework.


Solution

  • <!DOCTYPE html>
    <html>
    
     <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Untitled</title>
    <link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="assets/css/styles.css">
    </head>
    
    <body>
    <div>
        <div class="col-md-6">
            <h1>text is here!</h1></div>
        <div class="col-md-6"><img src="assets/img/Screenshot (236).png"></div>
    </div>
    <script src="assets/js/jquery.min.js"></script>
    <script src="assets/bootstrap/js/bootstrap.min.js"></script>
    

    here goes the style file AKA CSS

    div{
      background-color:yellow;
    }
    
    back{
    }
    
    body{
      background-color:yellow;
    }
    

    enter image description here