Alternative to display:flex

后端 未结 2 1585
说谎
说谎 2021-01-23 22:41

Trying to get rid of display: flex because its not compatible with internet explorer versions. Need an alternative to display my header inline and centered. I\'ve tried to use i

2条回答
  •  遥遥无期
    2021-01-23 23:14

    I used some float and position changes to your markup to get you started. you may need to modify to get the alignment you wanted

    html, body {
            position: relative;
            margin: 0;
            padding: 0;
            background-image: url("backround.jpg");
            background-repeat: repeat-y;
        }
        /*Nav Menu/Home Page*/
    
        .index-header {
           /* display: flex;*/
            position: fixed;
            justify-content: center;
            align-items: center;
            width: 100%;
            background-image: url("header.jpg");
            background-position: center;
            z-index: 1;
            text-transform: uppercase;
            border-bottom: 5px solid #ff8000;
            border-top: 5px solid #ff8000;
            text-shadow: 2px 2px #000;
        }
    
        header h2 {
            font-family: Georgia;
            font-size: 1.6em;
            color: #fff;
            text-shadow: 3px 3px #000;
            top: 12px;
        position: relative;
        }
    
        nav {
            padding: 1%;
            overflow: hidden;
            float:left;
        }
    
        nav a {
            float: left;
            display: block;
            color: #ff8000;
            text-align: center;
            padding: 14px 16px;
            text-decoration: none;
            font-size 17px;
            font-family: helvetica;
            letter-spacing: 2px;
        }
    
        nav li, nav ul{
            list-style: none;
        }
    
        nav a:hover {
            background-color: #fff;
            color: #ff8000;
        }
    
        nav .material-icons {
            padding-bottom: 5px;
            display: none;
            font-size: 36px;
            color: #ff8000;
        }
    nav i,nav a ,.index-header h2{
    display:inline;
    }
        @media screen and (max-width: 600px) {
        nav a:not(:first-child) {display: none;}
        nav .material-icons {
            float: left;
            display: block;
        }
        header h2 {
        
        }
        }
        
        
        
            
                
                
                
                
                 Knox Enterprises Inc.
            
            
                

    Knox Enterprises Inc.

提交回复
热议问题