1
I have the following code:
<?php include ("head.php");?>
<title>módulo EAD</title>
<body>
<div class="container">
<header>
<div class="page-header">
<h1>Bem vindo ao módulo EAD</h1>
<hr>
</div>
</header>
<?php include ("menuLateral.php");?>
</div>
</body>
</html>
head.php is just a file to load the CSS files:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="css/vertical.css">
</head>
this is menulatera.php:
<?php include ("head.php");?>
<div class="vertical-menu">
<a href="#" class="active">Home</a>
<a href="#">link 1</a>
<a href="#">link 2</a>
</div>
and his CSS:
.vertical-menu {
width: 200px; /* Set a width if you like */
}
.vertical-menu a {
background-color: #eee; /* Grey background color */
color: black; /* Black text color */
display: block; /* Make the links appear below each other */
padding: 12px; /* Add some padding */
text-decoration: none; /* Remove underline from links */
}
.vertical-menu a:hover {
background-color: #ccc; /* Dark grey background on mouse-over */
}
.vertical-menu a.active {
background-color: #4CAF50; /* Add a green color to the "active/current" link */
color: white;
}
When I call the main code page, the return I have of menulateral.php include, are just the 3 hyperlinks of the 'a' contained in this file, one next to the other!
the idea is to be able to implement a menu like the one provided as tutorial in this link: https://www.w3schools.com/howto/howto_css_vertical_menu.asp#
I got the title! sorry.
– Mikhael Araujo
Just one remark: has a <title> tag before the <body> and after the </head> in the first code snippet.
– Amzero
but that makes no difference. does <?php include ("head.php");? > already include the entire head structure I’m going to use.
– Mikhael Araujo
His CSS is being loaded into that file?
– sNniffer
Where is this CSS code from the menu you cite? It doesn’t make much sense for you to use the files either
bootstrap.css
andbootstrap.min.css
, both are the same files, the second being the minified version of the first.– Woss
And check your file tree...to see if css is correct
– MagicHat
css is being loaded here: <link rel="stylesheet" type="text/css" href="css/vertical.css"> this is the last line of head.php... I also deleted bootstrap min
– Mikhael Araujo
face, take a look at the browser console
aperte F12
, if the file address is wrong appears there– Max Rogério
apparently, everything normal =\
– Mikhael Araujo