Skip to content

Conversation

juanolmedo1
Copy link

No description provided.

<div class="box">
<img src="./images/asus.jpg" alt="Asus Laptop Image">
<p class="title">
Asus <br>
Copy link

@matiasbiasolazani matiasbiasolazani Sep 17, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should not use <br> for layout reasons - use display: block elements instead.

E.g: <span> Asus </span>


.title {
background-color: rgba(128, 128, 128, 0.7);
position: relative;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Remember to use "position: relative" in your "container or parent" element. E.g: <div class="box">. After that, you will have to set "position: absolute" in your child element, in this case <div class="title">. It will be better.


img {
width: 100%;
height: inherit;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Be careful using "inherit" value. Remember that inherits this property from its parent element.
  • Use "height: auto".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants