Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

difference between inline and inline-block should include discussion about replaced / non-replaced elements #160

Open
tiansh opened this issue Jan 15, 2019 · 2 comments
Labels
help wanted Extra attention is needed

Comments

@tiansh
Copy link

tiansh commented Jan 15, 2019

It is reasonable to answer this question only regard non-replaced elements, since for replaced elements, display inline or inline-block are actually (almost?) the same. But without mentioned of replaced elements, its answer is a bit misleading, somehow.

@yangshun yangshun added the help wanted Extra attention is needed label Jan 27, 2020
@yangshun
Copy link
Owner

Further reading regarding replaced elements - http://ahmed.amayem.com/html-replaced-elements-non-replaced-elements-examples/

@ShobikaG
Copy link

The displaying behaviour may be same but it is not same in styling , it cannot be replaced at a whole .

In styling point of view, display:inline and display:inline-block has almost same properties like setting width , height , top , bottom , margins . But,
display:inline is not respected to padding but in display:inline-block they are.

Example:

Let's give the same properties and same code in both the display properties

display:inline :-

Here padding is not excecuted or worked.

.od
{
      display:inline;
      width:95px;
      height:50px;
      **padding:18px;**
      background-color: skyblue;
      border:2px solid rgb(35, 35, 243);
      border-radius:10px;
      color:rgb(3, 3, 142);
}

Output:-

Screenshot (73)

For full source-
inline.txt

display:inline-block :-

Here padding property is excecuted or worked.

.od
{
      display:inline-block;
      width:95px;
      height:50px;
      **padding:18px;**
      background-color: skyblue;
      border:2px solid rgb(35, 35, 243);
      border-radius:10px;
      color:rgb(3, 3, 142);
}

Screenshot (72)

For full source -
inline-block.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants