css3 - How to position 2nd element center when 1st element pushing to right in CSS -


I am very new to CSS and I created a call directory which displays an icon on the left and the person's name next to it. It does this I am printing my phone number in the next line. The phone number is allocated in the center but not always the name

To make it a center, I wrap all my stuff in a div

  & lt; Div class = "container thumbnail" id = "all1" tabindex = "5000" align = "center" & gt; & Lt; / Div & gt;  

I have created a JSFDial:

How can I focus on the person's name when it presses the small icon name correctly?

As you learn more, you will find that you really want to use a real IMG tag Are there. In this situation, the image should be the background of the element next to it, in this way, you can position it wherever you want without pushing it around your position. When you are changing it, you want to make markup more semantic (as defined by the function as possible and rather than the style). I give some suggestions:

HTML

  & lt; Dl & gt; & Lt; Dt & gt; & Lt; A href = "#" & gt; 1 name & lt; / A & gt; & Lt; / Dt & gt; & Lt; Dd & gt; Details 1 & lt; / Dd> & Lt; Dt & gt; & Lt; A href = "#" & gt; 2 names & lt; / A & gt; & Lt; / Dt & gt; & Lt; Dd & gt; Details 2 & lt; / Dd> & Lt; / DL & gt;  

css

  dt {background: url ('icon.png') Any repeat center; }  

Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -