here is my index.html:
<div id="container1" class="py-0 my-0">
<div id="left" class="col-md-6">
<img class="image" src="C:\Users\asus\Desktop\project\image.png">
</div>
<div id="right" class="col-md-6">
<nav class="navbar navbar-expand-lg">
<ul class="navbar-nav ml-auto">
<li class="nav-index">
HOME
</li>
<li class="nav-index">
ABOUT US
</li>
<li class="nav-index">
COURSES
</li>
<li class="nav-index">
LOG IN
</li>
</ul>
</nav>
<br>
<br>
<br>
<br>
<br>
<p class="paragraph col-md-6">
<h3 class="Welcome text-center">Welcome to mobile legends!</h3>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<br>
<br>
<footer class="footer1" id="footer1">
<h6>Contact the developer:</h6>
<p>luckyllemos0909#gmail.com</p>
</footer>
</div>
</div>
here is my style.css:
*{
box-sizing: border-box;
margin: 0;
padding: 0;
}
html, body{
width: 100%;
height: 100%;
padding: 0;
margin: 0;
align-items: center;
vertical-align: middle;
}
#container1{
width: 100%;
height: 100%;
vertical-align: middle;
display: flex;
align-items: center;
}
#left,
#right {
width: 50%;
height: 100%;
}
#left {
background: #ffd6dd;
align-items: center;
}
.image{
margin-top: 50px;
margin-left: -10px;
padding: 100px;
}
#right {
background: #FBAED2;
align-items: center;
}
.paragraph{
color: red;
margin: 50px;
}
.fa {
margin-top: none;
padding: 20px;
font-size: 20px;
width: 30px;
text-align: center;
text-decoration: none;
margin: 5px 2px;
}
.fa:hover {
opacity: 0.7;
}
.fa-facebook {
color: #000000;
}
.fa-linkedin {
color: #000000;
}
.fa-youtube {
color: #000000;
}
.Welcome{
margin-left:60px;
}
.nav-link{
color: #000000;
}
.nav-index{
padding-left: 30px;
padding-right: 30px;
align-items: center;
}
my problem is when i put it in mobile phone it does not go flexible.
This is the original output:
and This what happens when try to look on mobile screen:
What you're looking for is media queries, which let you decide how your website looks on varying screen sizes. In the example below in the css class example is first shown how it would look on a larger screen size, then below with the media query in effect you can stylize how your page would look on a (in this example) a screen with a width of less than 900px. Take a look at the link below for further explanation.
.example {
font-family: "Droid+Sans";
font-weight: normal;
color: #ffffff ;
font-size: 7rem;
position: absolute;
top: 17%;
width: 100%;
}
#media screen and (max-width: 900px){
.example {
font-size: 3.5rem;
margin: auto;
width: 50%;
left: 20%;
right: 20%;
padding-bottom: 100px;
}
}
https://www.w3schools.com/css/css_rwd_mediaqueries.asp
Use Bootstrap Utility Classes in a better way. Since you are using bootstrap simply add your classes to work for different break points.
Add col-12 Utility classes on the following elements: Note that Bootstrap follows mobile-first approach.
<div id="left" class="col-12 col-md-6">
And
<div id="right" class="col-12 col-md-6">
Related
*Hello, I want to have text below the image like in the example, but I can't figure out what is wrong, i took the code from
W3Schools: https://www.w3schools.com
/css/tryit.asp?filename=trycss_ex_images_card
Can someone help? Thanks
Example Image: https://imgur.com/a/P86DVjW
What It Looks Like: https://imgur.com/a/JOXpAJI*
```{
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Poppins', sans-serif;
}
body {
background: #32053d;
}
header {
position: absolute;
top: 0;
Left: 0;
width: 100%;
padding: 30px 100px;
display: flex;
justify-content: space-between;
align-items: center
}
header .logo
{
color: #fff;
font-weight: 700;
text-decoration: none;
font-size: 2em;
text-transform: uppercase;
letter-spacing: 2px;
}
header ul
{
display: flex;
justify-content: center;
align-items: center;
}
header ul li
{
list-style: none;
margin-left: 20px;
}
header ul li a
{
text-decoration: none;
padding: 6px 15px;
color: #fff;
border-radius: 20px;
}
header ul li a:hover,
header ul li a.active
{
background: #fff;
color: #4a2880;
}
h1 {
color: white;
margin-top: 250px;
margin-left: 270px;
}
p {
color:white;
margin-left: 60px;
text-align: center;
font-size: 15px;
}
.sec {
margin-right: 80px;
}
div.polaroid {
width: 80%;
background-color: white;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
margin-bottom: 25px;
}
div.container {
text-align: center;
padding: 10px 20px;
}
```<!DOCTYPE html>
<html>
<h1>ABC</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
<center><img src="images/ArrowDown.webp" id="arrow" width="200"></center>
<div class="sec">
<center> <div class="polaroid">
<img src="Images/Darbs1.png" alt="Darbs1" style="width:100%">
<div class="container">
<p>Code</p>
</div>
</div> </center>
<center> <div class="polaroid">
<img src="images/Darbs1.png" alt="Darbs2" style="width:100%">
<div class="container">
<p>Code</p>
</div>
</div> </center>
<head>
<title>Projects</title>
<link rel="stylesheet" type="text/css" href="Website.css"
</head>
<body>
<header>
Logo
<ul>
<li>Home</li>
<li>About</li>
<li>Work</li>
<li>Contact</li>
</ul>
</header>
</body>
</html>```
The problem is with the css. You have set the p tag color:white that is why it is not showing. Set color:black
p {
color:black;
margin-left: 60px;
text-align: center;
font-size: 15px;
}
I approve of Usama's answer, the description is written in white on a white background.
You can add a specific rule:
.polaroid .container p {
color:black;
}
PS: Can you reformat your code?
Use 4 spaces or the button {} in the text editor
I have made 2 navbars: top which is static and side one which has on hover effect. I would like it to resize when on hover (I already accomplished that) but when it's width is going up the main content remains the same. How may I connect it so main content will move a bit as well?
Link: JS FIDDLE
<!-- Top navigation -->
<div class="topnav">
<!-- Centered link -->
<div class="topnav-centered">
Home
</div>
<!-- Right-aligned links -->
<div class="topnav-right">
Register <span><i class="fa fa-user-plus" aria-hidden="true"></i></span>
Log In <span><i class="fa fa-user" aria-hidden="true"></i></span>
</div>
</div>
<nav class="navbar">
<ul class="navbar-nav">
<li class="menu"><i class="fa fa-bars" aria-hidden="true"></i> Menu</li>
<li class="logo"><span class="link-text">Library</span></li>
<li class="nav-item"><span class="link-text">Home</span></li>
<li class="nav-item"><span class="link-text">About</span></li>
<li class="nav-item"><span class="link-text">Contact</span></li>
<li class="nav-item"><span class="link-text">More</span></li>
</ul>
</nav>
<main>
Thanks
I've only added one rule in css to accomplish it.
.navbar:hover+main {
margin-left: 10rem;
}
So when .navbar is hovered get the next child with tag main and give it margin-left as the same amount as the width of the sidebar. you could add a transition to make it look smooth
:root {
font-size: 16px;
}
body {
color: black;
margin: 0px;
padding: 0px;
}
main {
margin-left: 5rem;
margin-right: 5rem;
padding: 3rem;
}
.navbar {
width: 6rem;
height: 100%;
position: fixed;
background-color: transparent;
transition: width 200ms ease;
}
.navbar-nav {
list-style: none;
padding: 0;
margin: 0;
display: flex;
flex-direction: column;
align-items: center;
height: 100%;
}
.nav-item {
width: 100%;
}
.nav-link {
display: flex;
align-items: center;
height: 2rem;
filter: grayscale(100%) opacity(0.7);
text-decoration: none;
font-size: 1.2rem;
text-align: center;
}
.nav-link:hover {
filter: grayscale(0%) opacity(1);
background-color: lightblue;
}
.link-text {
display: none;
margin-left: 1rem;
}
.navbar:hover {
width: 10rem;
background-color: #333;
transition: all 0.3s ease-in-out;
}
.navbar:hover+main {
margin-left: 10rem;
}
.navbar:hover .link-text {
display: block;
align-items: center;
}
.logo {
font-weight: bold;
text-transform: uppercase;
margin-bottom: 2rem;
margin-top: 2rem;
text-align: center;
font-size: 1.5rem;
letter-spacing: 0.3ch;
width: 100%;
}
#menu {
margin-left: 10px;
text-align: center;
color: black;
font-size: 2rem;
}
#menu:hover {
margin-left: 10px;
text-align: center;
color: gold;
font-size: 2rem;
}
/* Add a black background color to the top navigation */
.topnav {
position: absolute;
/*position: relative;*/
background-color: #333;
overflow: hidden;
padding-left: 3rem;
width: 100%
}
/* Style the links inside the navigation bar */
.topnav a {
float: left;
color: #f2f2f2;
text-align: center;
padding: 14px 16px;
text-decoration: none;
font-size: 1rem;
}
/* Change the color of links on hover */
.topnav a:hover {
background-color: #ddd;
color: black;
}
/* Add a color to the active/current link */
.topnav a.active {
background-color: #4CAF50;
color: white;
}
/* Centered section inside the top navigation */
.topnav-centered a {
float: none;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
/* Right-aligned section inside the top navigation */
.topnav-right {
float: right;
}
/* Responsive navigation menu - display links on top of each other instead of next to each other (for mobile devices) */
#media screen and (max-width: 600px) {
.topnav a,
.topnav-right {
float: none;
display: block;
}
.topnav-centered a {
position: relative;
top: 0;
left: 0;
transform: none;
}
}
i {
font-size: 1rem;
padding-right: 5px;
}
a span {
position: relative;
}
<!-- Top navigation -->
<div class="topnav">
<!-- Centered link -->
<div class="topnav-centered">
Home
</div>
<!-- Right-aligned links -->
<div class="topnav-right">
Register <span><i class="fa fa-user-plus" aria-hidden="true"></i></span>
Log In <span><i class="fa fa-user" aria-hidden="true"></i></span>
</div>
</div>
<nav class="navbar">
<ul class="navbar-nav">
<li class="menu"><i class="fa fa-bars" aria-hidden="true"></i> Menu</li>
<li class="logo"><span class="link-text">Library</span></li>
<li class="nav-item"><span class="link-text">Home</span></li>
<li class="nav-item"><span class="link-text">About</span></li>
<li class="nav-item"><span class="link-text">Contact</span></li>
<li class="nav-item"><span class="link-text">More</span></li>
</ul>
</nav>
<main>
<h1>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure
dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure
dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</main>
If you don't want your main content to become smaller but just move to the right entirely you can add margin-right: -10rem; but it will be hard to get that to be responsive.
I'm trying to create a simple web page consisting of three divs: A header div containing an image, a content div containing text and a nav div containing the nav elements and a logo. My goal is to overlap the header div with the nav div so that the nav elements and the logo are always positioned vertically centered on the lower border of the header div.
Here's my code so far:
<!DOCTYPE html>
<html>
<head>
<title>TITLE</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body {
text-align: center;
}
#headerimage {
height: 100%;
width: 100%;
z-index: 50;
position: relative;
}
#headerimage > img {
max-width: 100%;
max-height: 100%;
border: 6px;
border-style: solid;
border-color: #671013;
}
#nav {
width: 100%;
overflow: visible;
top: 97.75%;
z-index: 100;
position: absolute;
}
#nav > img {
text-align: center;
vertical-align: middle;
margin-top: -6.2%;
height: 20%;
width: 20%;
}
.nav-element {
width: 10%;
height: 100%;
padding: 5px;
font-family: Impact, Haettenschweiler, 'Arial Narrow Bold', sans-serif;
text-align: center;
font-weight: bold;
border: 4px;
border-style: solid;
border-color: #2d3139;
background-color: white;
color: #80857f;
}
.nav-element:hover {
background-color: #2d3139;
color: white;
cursor: pointer;
}
.left {
float: left;
z-index: 100;
}
.first {
margin-left: 3%;
}
.right {
float: right;
z-index: 100;
}
.last {
margin-right: 3%;
}
#point2 {
margin-left: 9%;
}
#point3 {
margin-right: 9%;
}
#content {
height: 100%;
width: 100%;
}
#text {
padding-top: 8%;
padding-left: 3%;
padding-right: 3%;
padding-bottom: 5%;
text-align: justify center;
font-family: Impact, Haettenschweiler, 'Arial Narrow Bold', sans-serif;
}
</style>
</head>
<body>
<div id="headerimage">
<img src="https://images.pexels.com/photos/34577/pexels-photo.jpg" alt="Headerimage" />
<div id="nav">
<div id="point1" class="nav-element left first">
Point 1
</div>
<div id="point2" class="nav-element left ">
Point 2
</div>
<img src="https://pixabay.com/get/55e2d3454853a814f1dc8460da2932771736dfe6575074_640.png" alt="Logo" />
<div id="point3" class="nav-element right last">
Point 3
</div>
<div id="point4" class="nav-element right">
Point 4
</div>
</div>
</div>
<div id="content">
<div id="text">
<h1>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim
ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit
in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur
sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt
mollit anim id est laborum.</h1>
</div>
</div>
</body>
</html>
Currently the nav div doesn't stay centered on the lower border and my online researches haven't brought any useful results so far, so if anyone has an idea to point me in the right direction, I'd be really grateful!
Hope this is what you want:
nav img {
margin-top: -40px;
}
#point1, #point2, #point3, #point4 {
margin-top: -40px;
}
Fine-tune the margin as fits.
I'm trying to make a vertical navbar on the left of the page which is as long as the website (i.e. stretches down to the footer). However, it is only the right height when there is nothing above it - when I add the site's title, the navbar gets longer than the site.
body{
padding: 0px;
margin: 10px auto 0 auto;
font-family: 'corbel','arial';
background: #fff;
color: #444; /* text colour */
max-width: 1500px;
height: auto;
position: relative;
}
footer{
background: #333;
color: #fff;
padding: .1em 3em;
width: auto;
margin-left: 130px;
}
h1{
text-align: center;
font-size: 85px;
padding: 10px;
margin: auto;
margin-top: 10px;
}
#content{
margin-left: 150px;
}
/* Navbar */
#navbar{
background-color: #599;
list-style-type: none;
overflow: hidden;
width: 130px;
margin: 0px;
font-family: 'corbel','arial';
text-align: center;
padding-left: 0px;
height: 100%;
float: left;
position: absolute;
}
#nav_li{
text-align: center;
}
#nav_a{
text-decoration: none;
margin: 10px;
display: inline-block;
color: white;
}
<h1>Website Title</h1>
<body>
<ul id='navbar'>
<li id='nav_li'><a id='nav_a' href='index.html'>Home</a></li>
<li id='nav_li'><a id='nav_a' href='gallery.html'>Gallery</a></li>
<li id='nav_li'><a id='nav_a' href='reviews.html'>Our reviews</a></li>
</ul>
<div id='nav_fill'> </div>
<div id='content'>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</div>
<footer>
<p>Content © Business Name - Website design ©</p>
</footer>
</body>
Big thanks to anyone who can help!
There are multiple ways of fixing this problem - the easiest is to just put the html, body background color as the sidebar in CSS (with height: 100%), then add a sticky header and footer at the top and bottom, and put a background-color on the container-element.
Something like this:
* { margin: 0; padding: 0;}
html, body {
height: 100%;
background: blue;
}
#content {
background: white;
}
h1 {
background: white;
position: absolute;
top: 0;
left: 0;
right: 0;
height: 3em;
}
#menu {
margin-top: 3.5em;
float: left;
width: 7em;
color: white;
}
#content {
background: white;
height: 100%;
margin: 3em 0 4em 7em;
padding-top: 3.5em;
}
footer {
position: fixed;
bottom: 0;
left: 0;
right: 0;
height: 4em;
background: gray;
}
<body>
<h1>This is a heading</h1>
<ul id="menu">
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ul>
<div id="content">
<p>Something goes in here</p>
</div>
<footer>This is the footer</footer>
</body>
Try using position:fixed, and min/max-height i also suggest to use calc(), to calculate good size of navbar.
Here You have jsfiddle
I tried the opacity with the help of this. It does work well, except for one thing. The div where I want to use the opacity has other contents in it too. So, when I use opacity in that parent div, the child div also gets effected! What to do so as to effect only the parent div and not the child divs? Any help will be greatly appreciated. Thank you.
html:
<div id="profile_rightbar">
<div id="shortcuts">
<div class="icon pink">
<a href="#">
<p>Pictures</p>
<p>210</p>
</a>
</div>
<div class="icon green">
<a href="#">
<p>Videos</p>
<p>210</p>
</a>
</div>
<div class="icon blue">
<a href="#">
<p>Forums</p>
<p>210</p>
</a>
</div>
<div class="icon orange">
<a href="#">
<p>Pages</p>
<p>210</p>
</a>
</div>
<div class="icon pink">
<a href="#">
<p>Followers</p>
<p>210</p>
</a>
</div>
<div class="icon green">
<a href="#">
<p>Following</p>
<p>210</p>
</a>
</div>
</div>
<div id="status">
<p>Always do your best. What you plant now, you will harvest later.</p>
</div>
<div id="write">
<textarea id="redactor" name="content">
<h2>Hello and Welcome</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</textarea>
</div>
<div id="activity">
<div class="picture">
<a href="#">
<p>The world is so perfect. How can one not love this beautiful world.</p>
<img src="image/world.jpg">
</a>
</div>
<div class="picture">
<a href="#">
<p>The world is so perfect. How can one not love this beautiful world.</p>
<img src="image/world.jpg">
</a>
</div>
<div class="forum">
<a href="#">
</a>
</div>
<div class="video">
<a href="#">
</a>
</div>
<div class="page">
<a href="#">
</a>
</div>
<div class="following">
<a href="#">
</a>
</div>
</div>
</div>
<div class="clear_right"></div>
css:
html, body {
width: 100%;
height: 100%;
}
#main_wrapper {
width:100%;
height: 100%;
background:url(../image/pantera.jpg) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-ms-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
#profile_page {
width: 800px;
margin: 0 auto;
overflow: hidden;
border: 1px solid red;
}
#username h1 {
text-align: center;
color: white;
}
#profile_leftbar {
width: 210px;
float: left;
}
#profile_picture {
background-color: white;
border-radius: 10px;
border: 1px solid #dbdbdb;
}
#profile_picture img {
display: block;
margin: 0 auto;
border: none;
max-width:190px;
padding: 8px;
}
#about {
background: #f4f4f4;
border-radius: 5px;
margin-top: 8px;
border: 1px solid #dbdbdb;
}
#about p {
text-align: center;
color: #000000;
padding-top: 3px;
padding-bottom: 3px;
}
#about hr {
height:1px;
border:0px solid ;
border-top:1px solid #ccc;
}
#follow_message {
width: 210px;
margin: 5px auto;
}
#follow_message li {
list-style-type: none;
float: left;
margin-left: 3px;
}
#follow_message a {
display: block;
width: 101px;
text-align: center;
height: 30px;
color: white;
text-decoration: none;
line-height: 30px;
margin: 2px 0;
background: maroon;
}
#profile_rightbar {
float: right;
width: 590px;
}
#shortcuts {
overflow: hidden;
width: 588px;
margin: 0 auto;
}
#shortcuts div {
float: left;
margin: 4px;
}
.icon a {
text-decoration: none;
text-align: center;
display: block;
color: white;
border-radius: 5px;
width: 88px;
padding: 1px;
}
.icon a:hover {
text-decoration: underline;
}
.pink a {
background-color:#d63175;
}
.green a {
background-color:#51b73c;
}
.blue a {
background-color:#2f8ae0;
}
.orange a {
background-color:#f7a809;
}
#status {
background-color:white;
box-shadow:5px 5px 20px 1px black;
max-width:490px;
word-wrap:break-word;
padding:6px;
margin: 15px auto;
text-align:center;
font-size:30px;
line-height: 32px;
}
#write {
width: 575px;
margin: 0 auto;
}
#write textarea {
font-size:20px;
max-width:575px;
width: 575px;
}
#activity {
margin: 10px;
width: 575px;
}
#activity {
border: solid red;
opacity: 0.2;
filter: alpha(opacity=20); /* IE8 and lower */
zoom: 1;
#activity div {
background: white;
margin: 0 auto;
}
#activity .picture a img {
display: block;
max-width: 540px;
margin: 0 auto;
}
.picture a {
color: black;
text-decoration: none;
}
.picture a p {
margin-top:15px;
margin-left:15px;
}
dont use opacity it affects all child elements
Use
background-color : rgba(255,255,255,0.2);
which blurs only the parent element.