HTML + CSS Rendered colors - html

I don't know why I'm getting two different colors when the page loads. I look into Computed and Styles tabs from the element inspector, but this shows me the same values for each one.
Image:
The first style is for the title, and the other for the "Seguir Leyendo", a "Read more" link, both on top of all, without alphas and nothing to give different tones.
Any clue why this could happend?
Add:
HTML:
<div class="blog_entry">
<div class="blog_entry_image">
<img src="img/blog_imagen_1.png" class="blog_image_home"alt="Blog entry 1">
</div>
<div class="blog_entry_desc">
<h2 class="blog_entry_title"><a href="home-blog-detail-one.html">Lorem ipsum dolor sit amet, consectetur
adipiscing lit. Phaiop ellus ut diam nibh consectetur adpiscing</a></h2>
</div>
<div class="blog_entry_date">
28 Diciembre 2014
</div>
<div class="blog_entry_text">
<p>Nulla arcu quam, tempor a mattis sit amet, efficitur eget ante. Integer elit
libero, rutrum eu augue ut, faucibus dictum nibh. Suspendisse vitae ex sit amet
tellus molestie interdum...</p>
</div>
<div class="blog_entry_options">
<img src="img/blog_facebook.png" alt="Facebook">
<img src="img/blog_twitter.png" alt="Twitter">
Seguir leyendo <img src="img/arrow_read_more.png" alt="Seguir leyendo">
</div>
<div class="clearfix"></div>
</div>
CSS:
.blog_entry_title {
font-size: 24px;
}
.blog_entry_title a, .blog_title_detail {
color: #008ed6;
text-decoration: none;
font-family: HelveticaNeueThin;
}
.blog_entry_options {
position: absolute;
bottom: 0;
right: 0;
}
.blog_entry_options a {
color: #008ed6;
position: absolute;
bottom: 0;
right: 0;
font-size: 17px;
}

By updating/resetting the font-weight you can see the magic :
CSS :
.blog_entry_title a{ font-weight: normal }

Related

I need to place text next to image, and stack them from top to bottom

I got a city landing page, below the main image I want to have one picture with float: right; and next to that is text. Below that, I want to have the same content but this time I used float: left; but the picture didn't position itself below the first one. They are in separate DIV-s with display: block;
HTML
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="../style/main-style.css">
<link href="https://fonts.googleapis.com/css?family=Open+Sans&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Dancing+Script&display=swap" rel="stylesheet">
<title>Moskva</title>
</head>
<body>
<!-- Header start -->
<header>
<div class="container">
<h1>Moskva</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut vel interdum purus. Nulla semper nisi vel volutpat tristique.</p>
</div>
<div class="container">
<nav>
<ul>
<li>Naslovnica</li>
<li>Galerija</li>
</ul>
</nav>
</div>
</header>
<!-- Header end -->
<!-- About city -->
<section id="opis">
<div class="container">
<div class="box">
<h3>Lorem Ipsum</h3>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut vel interdum purus. Nulla semper nisi vel volutpat tristique. Fusce eget quam sit amet dui consequat fermentum. Morbi dictum efficitur lorem a aliquam. Nam dapibus, lorem vel molestie tincidunt, urna ipsum vehicula sem, in vehicula dolor dui vel massa. Fusce a tortor est. Maecenas nec congue diam. Ut et ornare urna, id feugiat ex.Donec ac vehicula dolor, quis placerat arcu. Nam laoreet enim in varius tristique. Vestibulum feugiat sed nisl ac vestibulum. Cras quis pellentesque quam, eu sollicitudin enim. Curabitur massa elit, tempor vel leo in, laoreet placerat sem.
</p>
</div>
<hr>
<!-- Image-Text sections -->
<!-- Kremlin -->
<div class="box">
<h3>Kremlin</h3>
<img src="../images/kremlin-pic.jpg" alt="kremlin" class="right-img">
<br> <br>
<p>Najprepoznatljivija struktura Moskve bez sumnje je Kremlj, utvrđeni kompleks iz 15. stoljeća koji pokriva površinu od 275.000 četvornih metara okružen zidinama izgrađenim 1400-ih. Palača Grand Kremlj - koja ima preko 700 soba - nekad je bila obitelj kralja i sada je službeno prebivalište predsjednika Ruske Federacije, iako većina šefova država odlučuje prebivati ​​negdje drugdje.</p>
</div>
<!-- Kremlin End -->
<!-- Bolshoi Theatre Start -->
<div class="box">
<h3>Bolshoi Theatre</h3>
<img src="../images/bolshoi-theatre.jpg" class="left-img">
</div>
<!-- Bolshoi Theatre End -->
</section>
</body>
</html>
CSS
body {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Open Sans', sans-serif;
line-height: 1.5;
background-color: #f4f4f4;
}
/* Global container */
.container {
width: 80%;
margin: auto;
overflow: hidden;
text-align: center;
}
.box {
text-align: center;
display: block;
}
/* Header section */
header {
text-align: center;
padding-top: 30px;
background: url(../images/background.jpg) no-repeat;
min-height: 690px;
}
header h1 {
font-size: 95px;
font-weight: bold;
color: white;
font-family: 'Dancing Script', cursive;
}
header p {
color: white;
}
nav {
margin-top: 4%;
}
/* Anchor tags section */
header a {
color: white;
text-decoration: none;
font-size: 24px;
transition: linear .2s;
}
header a:hover {
color: #ccc;
font-weight: bold;
}
/* Anchor tags section end */
header li {
display: inline;
padding: 0px 40px 0px 20px;
}
/* Header section END */
/* Image-Text section */
h3 {
font-size: 28px;
font-family: 'Dancing Script', cursive;
}
/* Image float - RL */
.right-img {
float: right;
}
.left-img {
float: left;
}
First of all when you are using float so you need to add overflow hidden in Parent.
The float CSS property places an element on the left or right side of its container, allowing text and inline elements to wrap around it. The element is removed from the normal flow of the page, though still remaining a part of the flow (in contrast to absolute positioning).
So you have to add overflow: hidden; CSS, please review below as I create an example for the same.
I add a link in comment for better understanding.

Can’t get the text to appear below the Image

I am trying to make the text appear below the image but it is not budging at all. My goal is it make the text appear below the image in the container
.left-col p {
text-align: justify;
width: 300px;
}
.left-col img {
margin: 0 auto;
left: 5%;
width: 300px;
height: 130px;
position: absolute;
text-align: center;
}
</head>
<body>
<div class="header">
<h1>The 3 Column Layout</h1>
</div>
<div class="container">
<div class="left-col">
<img src="Cyber.jpg" width="200" height=150"/>
<p>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec iaculis neque nec luctus maximus. Donec eu eleifend libero, nec scelerisque metus. Morbi volutpat turpis pretium
</p>
Instead of using position absolute, remove it. Reason is that the element is positioned relative to its first positioned (not static) ancestor element. So, you could of course mess with top, right and left values to make it work but it would not be responsive at all.
Read more about it here: MDN Position CSS
The default value of position is static, this way the elements renders in a specific order(its what you want, render img and p after).
This is the pen if you need:
<div class="header">
<h1>The 3 Column Layout</h1>
</div>
<div class="container">
<div class="left-col">
<img src="https://via.placeholder.com/200x150" width="200" height="150" />
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec iaculis neque nec luctus maximus. Donec eu eleifend libero, nec scelerisque metus. Morbi volutpat turpis pretium </p>
</div>
</div>
.left-col p{
text-align: justify;
width:300px;
}
.left-col img{
width:300px;
height: 130px;
}
Also, instead of setting width 300px to paragraph and img, you could set only one time to your .left-col div. I have also removed other properties that you were not using.
another note is that you forgot the " on height attribute.
In css there is use [ position absolute ] For the image and is not used in the text You must set the position in the image and the text or leave it to the default setting I deleted it from the image properties in css
.left-col p{
text-align: justify;
width:300px;
}
.left-col img{
margin: 0 auto;
left: 5%;
width:300px;
height: 130px;
text-align:center;
}
<body>
<div class="header">
<h1>The 3 Column Layout</h1>
</div>
<div class="container">
<div class="left-col">
<img src="Cyber.jpg" width="200" height=150"/>
<p><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec iaculis neque nec luctus maximus. Donec eu eleifend libero, nec scelerisque metus. Morbi volutpat turpis pretium </p>
</body>
Remove the line 'position: absolute;' from CSS. Complete (close) the DIV and P tags. You may introduce '.container{...}' where you may position (or whatever) the image-and-text together. You may wish to use 'margin: 0;' to glue the text to the image. Good luck!

Looking at a problem with image overlapping nav bar

I got this issue that a portrait is overlapping my nav bar.
And I've been looking around and trying to find a fix, but no luck.
I have tried z-index, but sadly didn't work at all.
My code for the section:
/*Navbar CSS*/
.topNavMain,
.topNavMain ul {
margin: 0;
padding: 0;
background: rgba(227, 232, 237, 0.40);
color: #5f6f81;
list-style: none;
text-transform: none;
text-decoration: none;
width: 100%;
font-weight: 300;
font-family: 'Lato', Arial, sans-serif;
line-height: 60px;
z-index: 999 !important;
}
/*img class CSS*/
.imgPortrait {
width: 80%;
z-index: -999;
overflow: hidden;
}
<section id="aboutMe" class="contentS">
<div class="container">
<div class="row">
<div class="col slideIn margin-fix">
<h2 class="contentT">About me</h2>
<p class="shortText">Lorem ipsum dolor sit amet, consectetur adipiscing elit. <br> Fusce mollis pretium felis id ultricies. Sed libero risus, volutpat vel rhoncus et, auctor non ipsum. <br> Praesent sollicitudin nibh nisl, et sagittis nulla ornare at.</p>
</div>
<div class="col slideIn2">
<img src="img/portrait.jpg" alt="" class="imgPortrait img-fluid"></img>
</div>
</div>
</div>
</section>
Screenshot of my issue:
Click here.
Just a simple fix, you need to apply a z-index to the div containing the nav, not just the ul.
#navDiv {
z-index: 1;
}
In my case the arrows of the carousal overlapped with the navbar. As the arrow icons already had z-index as 1 so in my case I had to make the z-index of the navbar div as 2 and it worked.

How to display a <p> within a <div>element with the display property of inline-block?

This is what I am currently working on...
.scake_one {
color: #cc3300;
display: inline-block;
}
.scake_two {
color: #cc3300;
display: inline-block;
}
.scake_three {
color: #cc3300;
display: inline-block;
}
<div class="scake_one">
<h1>CAKE ONE</h1>
<p>Lorem ipsum etiam porttitor ultrices
<br>tortor tempus vehicula.</p>
</div>
<div class="scake_two">
<h1>CAKE TWO</h1>
<p>Lorem ipsum eu quisque velit
<br>quam convallis massa tellus.</p>
</div>
<div class="scake_three">
<h1>CAKE THREE</h1>
<p>Lorem ipsum sed mauris aenean
<br>pretium pulvinar.</p>
</div>
I was able to use this property well with an other section that had < h1 > and < li > elements. I was able to used inline-block because they are block level elements? I saw this info on the w3 site
http://www.w3schools.com/htmL/html_blocks.aspI also saw that < div > tags are also block level elements. I can't seem to understand why it isn't working.
Here you go! You need float-left, and the width needs to tell it to take up a third of the screen.
Also, just as a style thing, you can give all of your "scake" the same class name, because the CSS styling is the same for each one. Then if you change the style on one, it'll update it for all of them.
.scake {
color: #cc3300;
display: inline-block;
float: left;
max-width: 32%;
margin-left: .5%;
margin-right: .5%;
}
<div class="scake">
<h1>CAKE ONE</h1>
<p>Lorem ipsum etiam porttitor ultrices
<br>tortor tempus vehicula.</p>
</div>
<div class="scake">
<h1>CAKE TWO</h1>
<p>Lorem ipsum eu quisque velit
<br>quam convallis massa tellus.</p>
</div>
<div class="scake">
<h1>CAKE THREE</h1>
<p>Lorem ipsum sed mauris aenean
<br>pretium pulvinar.</p>
</div>

Website is responsive on my laptop, but not on phones or tablets

This is a problem with the website as a whole, not just one div or section.
To make my website responsive, I am using media queries. To help me with responsive styling, I am using Grids.css. I set a media query as follows:
#media only screen and (max-width: 850px) {
.section-web-projects {
height: 290vh;
}
.skills div.col {
width: 100%;
}
.skills-div {
width: 100%;
height: auto;
padding-bottom: -20px;
text-align:center;
margin-right: 50px;
margin-left: - 50px;
font-size: 100%;
}
}
This corresponds to the following in html :
<div class="row">
<h2 class="section-header"></h2>
</div>
<div class="row">
<h2 class="hireme-web"> Lorem ipsum dolor sit amet, consectetur adipiscing elit </h2>
<div class="skills">
<div class="col span-1-of-4">
<div class="skills-div">
<h3> <i class="ion-iphone skills-div-icon"></i> <i class="ion-ios-monitor-outline skills-div-icon"></i> <i class="ion-ipad skills-div-icon"></i> <br> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc et diam volutpat, eleifend ex vel, rutrum nisl. Morbi gravida, libero a imperdiet vehicula, ante erat pretium metus, in scelerisque velit elit tincidunt eros <br> <br> </h3>
</div>
</div>
<div class="col span-1-of-4">
<div class="skills-div">
<h3> <i class="ion-ios-locked-outline skills-div-icon"></i> <br> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc et diam volutpat, eleifend ex vel, rutrum nisl. Morbi gravida, libero a imperdiet vehicula, ante erat pretium metus, in scelerisque velit elit tincidunt eros <br> <br> </h3>
</div>
</div>
</div> <!-- end of skills -->
</div> <!-- end of row -->
</section>
And this is the corresponding styling without any media queries:
* {
box-sizing:border-box;
}
.row {
max-width: 80%;
margin: 0 auto;
}
.skills {
width: 100%;
float: left;
background-color: antiquewhite;
}
.skills-div {
padding: 10px;
background-color: #1abc9c;
opacity: 0.8;
text-align:left;
margin-bottom: 30px;
border-radius: 50px;
width: 200px;
height: auto;
margin-top: 10px;
margin-left: 10px;
margin-right: 5px;
font-size: 90%;
}
Here is what it looks like on Google Nexus 4 at 384 px:
Here is what it looks like on chrome window at 400px . This is the effect I want and have encoded into the media query; but its not working.
You have not posted your full source code.
But I 'll bet you've forgotten the viewport meta tag
Just put this inside your html <head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
For more infos check this site:
http://www.w3schools.com/css/css_rwd_viewport.asp
Try removing "only" from your media query. Also make sure you've added the viewport meta tag to the head of your webpage <meta name="viewport" content="width=device-width, initial-scale=1">