如何创建用于移动查看的下拉菜单栏?

时间:2019-05-14 16:38:18

标签: mobile navigationbar menubar

@charset "UTF-8";



/* ----------------- Reset all styles ----------------- */
*{
	margin:0;
	padding:0;
	border:0;
}

/* ----------------- Website background and general text colour ----------------- */
body{
	background-image:url(../images/backgroundtexture.png);
	background-color:#f9f9f9;
	color:#2d2d2d;
}


/* ----------------- Wrapper - keeps all content in the center of page -----------------  */
.wrapper{
	margin:auto;
	width:80%;
	height:auto;
}


/* The rest is pretty self explanatory - it appears in the order that it occurs on the HTML document */
#top{
	height:40px;
}

#logo{
	margin-top:5%;
	text-decoration:none;
}

#logoimage{
	width:222px;
	padding-right:126px;
	float:left;
}


#logotitle{
	float:left;
	font-family: Candara;
	font-weight:normal;
	font-size:215%;
	text-shadow: 0 1px 1px #FFF;
}

#logotitle a{
	color:#9933cc;
	text-decoration:none;
}

nav{
	float:right;
	width:70%;
	display:block;
	height:40px;
}

nav ul li{
	display:block;
	width:14%;
	float:left;
	text-align:center;	
}

nav ul li a{
	font-family: Candara;
	width:70%;
	text-decoration:none;
	text-transform:uppercase;
	font-weight:400;
	line-height:250%;
	display:block;
	color:#9933cc;
}

nav ul li a:hover{
	color:#4B0082;
}

nav ul li p{
	font-family: Candara;
	width:70%;
	text-decoration:none;
	text-transform:uppercase;
	font-weight:400;
	line-height:250%;
	display:block;
	color:#9933cc;
}

hr{
	height:1px;
	width:100%;
	background-color:#9933cc;
	margin:3% 0;
}

header{
	width:100%;
	margin:5% 0 5% 0;
}

header h1{
	font-family: Candara;
	text-align:center;
	font-size:140%;
	font-weight:normal;
	letter-spacing:1px;
	margin-bottom:1%;
}

header h1 span{
	color:#9933cc;
	text-shadow: 0 1px 1px #dadada;
}

header h2{
	font-family: Candara;
	text-align:center;
	font-size:100%;
	font-weight:normal;
}
	
#slideshow{
	width:100%;
	margin-top:2%;
}


/* - - - - - - - - - - - - - - -  Slider START  - - - - - - - - - - - - - - - */

.html_carousel {
}
.html_carousel div.slide {
	position: relative;
}	
.html_carousel div.slide img {
	width: 100%;
	height: auto;
	-webkit-box-shadow: 0 1px 1px #c1c1c1;
    -moz-box-shadow: 0 1px 1px #c1c1c1;
    box-shadow: 0 1px 1px #c1c1c1;
	border-radius:15px;
}

.clearfix {
	float: none;
	clear: both;
}

/* - - - - - - - - - - - - - - -  Slider END  - - - - - - - - - - - - - - - */

.eva{
	margin-left:10%;
}

.left{
	margin-top:4%;
	width:48%;
	float:left;
	margin-bottom:2%;
}

.left h3{
	font-family: Candara;
	font-size:180%;
	font-weight:normal;
	text-align:center;
	color:#9933cc;
	margin-bottom:5%;
	text-shadow: 0 1px 1px #dadada;
}

.left ol{
	font-family: Candara;
	font-size:100%;
	line-height:140%;
	font-weight:normal;
	//text-align:rigth;
	margin-bottom:5%;	
}

.left p{
	font-family: Candara;
	font-size:100%;
	line-height:140%;
	text-align:justify;
}

.left p a{
	color:#9933cc;
	text-decoration:none;
}
	
.right{
	margin-top:4%;
	width:48%;
	float:right;
	margin-bottom:2%;
}

.right h3{
	font-family: Candara;
	font-size:180%;
	font-weight:normal;
	text-align:center;
	color:#9933cc;
	margin-bottom:5%;
	text-shadow: 0 1px 1px #dadada;
}

.right p{
	font-family: Candara;
	font-size:100%;
	line-height:140%;
	text-align:justify;
}

.right p a{
	color:#9933cc;
	text-decoration:none;
}


/* ----------------------- WORK LINKS START ------------------------- */
#work{
	width:800px;
	margin:3% auto 3% auto;
}

.item{
	border-radius:15px;
	width:180px;
	height:185px;
	background-color:#FFF;
	margin:10px;
	float:left;
	-webkit-box-shadow: 0 1px 3px #c3c3c3;
    -moz-box-shadow: 0 1px 3px #c3c3c3;
    box-shadow: 0 1px 3px #c3c3c3;  
	overflow:hidden;
	-webkit-transition: box-shadow 0.2s ease-in-out;
	-moz-transition: box-shadow 0.2s ease-in-out;
	-o-transition: box-shadow 0.2s ease-in-out;
	-ms-transition: box-shadow 0.2s ease-in-out;
	transition: box-shadow 0.2s ease-in-out;
}

.item:hover{
	-webkit-box-shadow: 0 0 8px #9933cc, 0 0 8px #9933cc;
    -moz-box-shadow: 0 0 8px #9933cc,  0 0 8px #9933cc;
    box-shadow: 0 0 8px #9933cc,  0 0 8px #9933cc; 
}
	

.item img{
	display:block;
	width:100%;
	-webkit-box-shadow: 0 2px 1px #c3c3c3;
    -moz-box-shadow: 0 2px 1px #c3c3c3;
    box-shadow: 0 2px 1px #c3c3c3;
	border-radius:15px 15px 0 0;
	opacity:0.8;
	-webkit-transition: opacity 0.2s ease-in-out;
	-moz-transition: opacity 0.2s ease-in-out;
	-o-transition: opacity 0.2s ease-in-out;
	-ms-transition: opacity 0.2s ease-in-out;
	transition: opacity 0.2s ease-in-out;
	
}

.item img:hover{
	opacity:1;
}


.item h3{
	font-family: Candara;
	font-size:105%;
	font-weight:normal;
	padding:5px 0 0 8px;
	color:#2d2d2d;
	text-decoration:none;
}

.item h3 a{
	text-decoration:none;
	color:#2d2d2d;
}

.item p{
	font-family: Candara;
	font-size:70%;
	font-weight:normal;
	padding:0 0 0 8px;
	color:#9933cc;
	text-decoration:none;
}
/* ----------------------- WORK LINKS END ------------------------- */


#bottom h3{
	margin:4% 0 3% 0;
	font-family: Candara;
	font-size:190%;
	font-weight:normal;
	text-align:center;
	color:#9933cc;
	text-shadow: 0 1px 1px #c1c1c1;
}


footer{
	width:100%;
	padding:10px 0;
	background-color:#2d2d2d;
}

.icon{
	float:right;
	width:32px;
	margin:95px 0 2px 4%;
	opacity:0.85;
}

.icon:hover{
	opacity:1;
}

.social{
	color:#9933cc;
}


/* ----------------------------- FORM ----------------------------------- */

.left h4{
	font-family: Candara;
	font-size:180%;
	font-weight:normal;
	color:#9933cc;
	margin-bottom:10px;
}

#formwrap{
	width:100%;
}

.formstyle { 
	border: 1px solid #ccc;
	color: #000;
	font-family: Candara;
	font-size:14px;
	width: 95%;
	background-color:rgba(255,255,255,1);
	background-image:url(../images/backgroundtexture.png);
	margin-bottom:10px;
	opacity:0.9;
	padding:3px;
	-webkit-transition: all 0.4s ease-in-out;
   -moz-transition: all 0.4s ease-in-out;
   -o-transition: all 0.4s ease-in-out;
   -ms-transition: all 0.4s ease-in-out;
   transition: all 0.4s ease-in-out;
   border-radius:2px;
}

.formstyletwo { 
	color: #9933cc;
	font-family: Candara;
	font-size:15px;
	text-align:left;
	width:20%;
	background-color:#2d2d2d;
	border:0px;
	
}

.formstyletwo:hover { 
	color:#f38094;
	cursor:pointer;

}

textarea{ 
	border: 1px solid #ccc;
	color: #000;
	font-family: Candara;
	font-size:14px;
	width:95%;
	height:80px;
	background-color:rgba(255,255,255,1);
	background-image:url(../images/backgroundtexture.png);
	margin-bottom:10px;
	border-radius:2px;
	padding:3px;
	opacity:0.9;
	-webkit-transition: all 0.4s ease-in-out;
	-moz-transition: all 0.4s ease-in-out;
	-o-transition: all 0.4s ease-in-out;
	-ms-transition: all 0.4s ease-in-out;
	transition: all 0.4s ease-in-out;
}


input:focus, input.focused, textarea:focus, textarea.focused {  color: #3e3e3e; opacity:1;}

#error{
	color:#FF7471;
	float:left;
	font-family:Regular, Arial, Helvetica, sans-serif, "Helvetica Neue Light";
	font-size:15px;
}

#error ul{
	list-style-type: none;
	padding-top:5px;
}
	

/* -- Make the highlight colours pretty -- */
::selection      { background:#f38094; color:#FFF;}
::-moz-selection  { background:#9933cc; color:#FFF;}




/* ---------------------- RESPONSIVE STUFF - ONLY TOUCH IF YOUR'E CONFIDENT WITH CSS ---------------------- */


@media only screen and (max-width: 1279px) {
	.wrapper{
		width:90%;
	}
	
}

@media only screen and (max-width: 1105px) {
	
	#work{
		width:900px;
}

	.item{
		width:164px;
		height:170px;
		margin:8px;
	}
}

@media only screen and (max-width: 999px) {
	
	#work{
		width:750px;	
}

	.item{
		width:136px;
		height:144px;
		margin:7px;
	}
	
	.item h3{
		font-size:90%;
	}
	
	.item p{
		font-size:60%;
	}
}

@media only screen and (max-width: 835px) {
	
	#work{
		width:650px;	
}

	.item{
		width:116px;
		height:121px;
		margin:7px;
	}
	
	.item h3{
		font-size:75%;
	}
	
	.item p{
		font-size:40%;
	}
}

@media only screen and (max-width: 860px) {
	header h1{
		font-size:110%;
	}
	
	header h2{
		font-size:80%;
	}
}

@media only screen and (max-width: 720px) {
	
	#logo{
		width:150px;
		display:block;
		margin:auto;
		margin-bottom:5%;
	}
	
	nav{
		width:100%;
	}
	
	header h1{
		font-size:100%;
		margin-bottom:5%;
	}
	
	header h2{
		font-size:60%;
	}
	
	.left{
		width:100%;
	}
	
	.right{
		width:100%;
	
	}
	
	#work{
		width:460px;	
}

	.item{
		width:210px;
		height:215px;
		margin:10px;
	}
	
	.item h3{
		font-size:130%;
	}
	
	.item p{
		font-size:90%;
	}
}

@media only screen and (max-width: 510px) {
	
	#work{
		width:300px;	
	}

	.item{
		width:136px;
		height:140px;
		margin:7px;
	}
	
	.item h3{
		font-size:75%;
	}
	
	.item p{
		font-size:40%;
	}
}

我没有为在移动设备上查看页面时出现的菜单/导航栏创建css代码。 (因此,现在在手机上查看时,所有文本都重叠且混乱。)

是否有人能为我提供用于移动设备的基本菜单/导航栏的代码。 (我不是编码员。只是一名志愿者帮助运行此页面。)

此网站上的页面均以一个CSS代码(包含在此处)运行。我想获得第二个CSS代码的帮助,该代码可以用于移动设备观看。

这是所有页面运行的CSS。

@charset "UTF-8";



/* ----------------- Reset all styles ----------------- */
*{
    margin:0;
    padding:0;
    border:0;
}

/* ----------------- Website background and general text colour ----------------- */
body{
    background-image:url(../images/backgroundtexture.png);
    background-color:#f9f9f9;
    color:#2d2d2d;
}


/* ----------------- Wrapper - keeps all content in the center of page -----------------  */
.wrapper{
    margin:auto;
    width:80%;
    height:auto;
}


/* The rest is pretty self explanatory - it appears in the order that it occurs on the HTML document */
#top{
    height:40px;
}

#logo{
    margin-top:5%;
    text-decoration:none;
}

#logoimage{
    width:222px;
    padding-right:126px;
    float:left;
}


#logotitle{
    float:left;
    font-family: Candara;
    font-weight:normal;
    font-size:215%;
    text-shadow: 0 1px 1px #FFF;
}

#logotitle a{
    color:#9933cc;
    text-decoration:none;
}

nav{
    float:right;
    width:70%;
    display:block;
    height:40px;
}

nav ul li{
    display:block;
    width:14%;
    float:left;
    text-align:center;  
}

nav ul li a{
    font-family: Candara;
    width:70%;
    text-decoration:none;
    text-transform:uppercase;
    font-weight:400;
    line-height:250%;
    display:block;
    color:#9933cc;
}

nav ul li a:hover{
    color:#4B0082;
}

nav ul li p{
    font-family: Candara;
    width:70%;
    text-decoration:none;
    text-transform:uppercase;
    font-weight:400;
    line-height:250%;
    display:block;
    color:#9933cc;
}

hr{
    height:1px;
    width:100%;
    background-color:#9933cc;
    margin:3% 0;
}

header{
    width:100%;
    margin:5% 0 5% 0;
}

header h1{
    font-family: Candara;
    text-align:center;
    font-size:140%;
    font-weight:normal;
    letter-spacing:1px;
    margin-bottom:1%;
}

header h1 span{
    color:#9933cc;
    text-shadow: 0 1px 1px #dadada;
}

header h2{
    font-family: Candara;
    text-align:center;
    font-size:100%;
    font-weight:normal;
}

#slideshow{
    width:100%;
    margin-top:2%;
}


/* - - - - - - - - - - - - - - -  Slider START  - - - - - - - - - - - - - - - */

.html_carousel {
}
.html_carousel div.slide {
    position: relative;
}   
.html_carousel div.slide img {
    width: 100%;
    height: auto;
    -webkit-box-shadow: 0 1px 1px #c1c1c1;
    -moz-box-shadow: 0 1px 1px #c1c1c1;
    box-shadow: 0 1px 1px #c1c1c1;
    border-radius:15px;
}

.clearfix {
    float: none;
    clear: both;
}

/* - - - - - - - - - - - - - - -  Slider END  - - - - - - - - - - - - - - - */

.eva{
    margin-left:10%;
}

.left{
    margin-top:4%;
    width:48%;
    float:left;
    margin-bottom:2%;
}

.left h3{
    font-family: Candara;
    font-size:180%;
    font-weight:normal;
    text-align:center;
    color:#9933cc;
    margin-bottom:5%;
    text-shadow: 0 1px 1px #dadada;
}

.left ol{
    font-family: Candara;
    font-size:100%;
    line-height:140%;
    font-weight:normal;
    //text-align:rigth;
    margin-bottom:5%;   
}

.left p{
    font-family: Candara;
    font-size:100%;
    line-height:140%;
    text-align:justify;
}

.left p a{
    color:#9933cc;
    text-decoration:none;
}

.right{
    margin-top:4%;
    width:48%;
    float:right;
    margin-bottom:2%;
}

.right h3{
    font-family: Candara;
    font-size:180%;
    font-weight:normal;
    text-align:center;
    color:#9933cc;
    margin-bottom:5%;
    text-shadow: 0 1px 1px #dadada;
}

.right p{
    font-family: Candara;
    font-size:100%;
    line-height:140%;
    text-align:justify;
}

.right p a{
    color:#9933cc;
    text-decoration:none;
}


/* ----------------------- WORK LINKS START ------------------------- */
#work{
    width:800px;
    margin:3% auto 3% auto;
}

.item{
    border-radius:15px;
    width:180px;
    height:185px;
    background-color:#FFF;
    margin:10px;
    float:left;
    -webkit-box-shadow: 0 1px 3px #c3c3c3;
    -moz-box-shadow: 0 1px 3px #c3c3c3;
    box-shadow: 0 1px 3px #c3c3c3;  
    overflow:hidden;
    -webkit-transition: box-shadow 0.2s ease-in-out;
    -moz-transition: box-shadow 0.2s ease-in-out;
    -o-transition: box-shadow 0.2s ease-in-out;
    -ms-transition: box-shadow 0.2s ease-in-out;
    transition: box-shadow 0.2s ease-in-out;
}

.item:hover{
    -webkit-box-shadow: 0 0 8px #9933cc, 0 0 8px #9933cc;
    -moz-box-shadow: 0 0 8px #9933cc,  0 0 8px #9933cc;
    box-shadow: 0 0 8px #9933cc,  0 0 8px #9933cc; 
}


.item img{
    display:block;
    width:100%;
    -webkit-box-shadow: 0 2px 1px #c3c3c3;
    -moz-box-shadow: 0 2px 1px #c3c3c3;
    box-shadow: 0 2px 1px #c3c3c3;
    border-radius:15px 15px 0 0;
    opacity:0.8;
    -webkit-transition: opacity 0.2s ease-in-out;
    -moz-transition: opacity 0.2s ease-in-out;
    -o-transition: opacity 0.2s ease-in-out;
    -ms-transition: opacity 0.2s ease-in-out;
    transition: opacity 0.2s ease-in-out;

}

.item img:hover{
    opacity:1;
}


.item h3{
    font-family: Candara;
    font-size:105%;
    font-weight:normal;
    padding:5px 0 0 8px;
    color:#2d2d2d;
    text-decoration:none;
}

.item h3 a{
    text-decoration:none;
    color:#2d2d2d;
}

.item p{
    font-family: Candara;
    font-size:70%;
    font-weight:normal;
    padding:0 0 0 8px;
    color:#9933cc;
    text-decoration:none;
}
/* ----------------------- WORK LINKS END ------------------------- */


#bottom h3{
    margin:4% 0 3% 0;
    font-family: Candara;
    font-size:190%;
    font-weight:normal;
    text-align:center;
    color:#9933cc;
    text-shadow: 0 1px 1px #c1c1c1;
}


footer{
    width:100%;
    padding:10px 0;
    background-color:#2d2d2d;
}

.icon{
    float:right;
    width:32px;
    margin:95px 0 2px 4%;
    opacity:0.85;
}

.icon:hover{
    opacity:1;
}

.social{
    color:#9933cc;
}


/* ----------------------------- FORM ----------------------------------- */

.left h4{
    font-family: Candara;
    font-size:180%;
    font-weight:normal;
    color:#9933cc;
    margin-bottom:10px;
}

#formwrap{
    width:100%;
}

.formstyle { 
    border: 1px solid #ccc;
    color: #000;
    font-family: Candara;
    font-size:14px;
    width: 95%;
    background-color:rgba(255,255,255,1);
    background-image:url(../images/backgroundtexture.png);
    margin-bottom:10px;
    opacity:0.9;
    padding:3px;
    -webkit-transition: all 0.4s ease-in-out;
   -moz-transition: all 0.4s ease-in-out;
   -o-transition: all 0.4s ease-in-out;
   -ms-transition: all 0.4s ease-in-out;
   transition: all 0.4s ease-in-out;
   border-radius:2px;
}

.formstyletwo { 
    color: #9933cc;
    font-family: Candara;
    font-size:15px;
    text-align:left;
    width:20%;
    background-color:#2d2d2d;
    border:0px;

}

.formstyletwo:hover { 
    color:#f38094;
    cursor:pointer;

}

textarea{ 
    border: 1px solid #ccc;
    color: #000;
    font-family: Candara;
    font-size:14px;
    width:95%;
    height:80px;
    background-color:rgba(255,255,255,1);
    background-image:url(../images/backgroundtexture.png);
    margin-bottom:10px;
    border-radius:2px;
    padding:3px;
    opacity:0.9;
    -webkit-transition: all 0.4s ease-in-out;
    -moz-transition: all 0.4s ease-in-out;
    -o-transition: all 0.4s ease-in-out;
    -ms-transition: all 0.4s ease-in-out;
    transition: all 0.4s ease-in-out;
}


input:focus, input.focused, textarea:focus, textarea.focused {  color: #3e3e3e; opacity:1;}

#error{
    color:#FF7471;
    float:left;
    font-family:Regular, Arial, Helvetica, sans-serif, "Helvetica Neue Light";
    font-size:15px;
}

#error ul{
    list-style-type: none;
    padding-top:5px;
}


/* -- Make the highlight colours pretty -- */
::selection      { background:#f38094; color:#FFF;}
::-moz-selection  { background:#9933cc; color:#FFF;}




/* ---------------------- RESPONSIVE STUFF - ONLY TOUCH IF YOUR'E CONFIDENT WITH CSS ---------------------- */


@media only screen and (max-width: 1279px) {
    .wrapper{
        width:90%;
    }

}

@media only screen and (max-width: 1105px) {

    #work{
        width:900px;
}

    .item{
        width:164px;
        height:170px;
        margin:8px;
    }
}

@media only screen and (max-width: 999px) {

    #work{
        width:750px;    
}

    .item{
        width:136px;
        height:144px;
        margin:7px;
    }

    .item h3{
        font-size:90%;
    }

    .item p{
        font-size:60%;
    }
}

@media only screen and (max-width: 835px) {

    #work{
        width:650px;    
}

    .item{
        width:116px;
        height:121px;
        margin:7px;
    }

    .item h3{
        font-size:75%;
    }

    .item p{
        font-size:40%;
    }
}

@media only screen and (max-width: 860px) {
    header h1{
        font-size:110%;
    }

    header h2{
        font-size:80%;
    }
}

@media only screen and (max-width: 720px) {

    #logo{
        width:150px;
        display:block;
        margin:auto;
        margin-bottom:5%;
    }

    nav{
        width:100%;
    }

    header h1{
        font-size:100%;
        margin-bottom:5%;
    }

    header h2{
        font-size:60%;
    }

    .left{
        width:100%;
    }

    .right{
        width:100%;

    }

    #work{
        width:460px;    
}

    .item{
        width:210px;
        height:215px;
        margin:10px;
    }

    .item h3{
        font-size:130%;
    }

    .item p{
        font-size:90%;
    }
}

@media only screen and (max-width: 510px) {

    #work{
        width:300px;    
    }

    .item{
        width:136px;
        height:140px;
        margin:7px;
    }

    .item h3{
        font-size:75%;
    }

    .item p{
        font-size:40%;
    }
}

0 个答案:

没有答案