Micro blog about Answer to the Ultimate Question of Life, the Universe, and Everything.
  • Home
    • List all categories
    • Sitemap
  • Downloads
    • WebSphere
    • Hitachi902
    • Hospital
    • Kryptonite
    • OCR
    • APK
  • About me
    • Gallery
      • Italy2022
      • Côte d'Azur 2024
    • Curriculum vitae
      • Resume
      • Lebenslauf
    • Social networks
      • Facebook
      • Twitter
      • LinkedIn
      • Xing
      • GitHub
      • Google Maps
      • Sports tracker
    • Adventures planning
  1. You are here:  
  2. Home

Understanding vertical-align

Details
Written by: Stanko Milosev
Category: CSS
Published: 05 February 2016
Last Updated: 07 February 2016
Hits: 4889

Title (and content) of the article I stole from this web site.

From that same web site copy / paste of the key sentence:

HTML layout traditionally was not designed to specify vertical behavior

To have properly working vertical alignment, in my case, I had to introduce a table, this is my HTML:

<div style="height: 800px" class="detail-control">

	<table style="height:100%">
		<tbody>
			<tr>
				<td>
					<img style="vertical-align: middle" border="0" alt="Please press the play button." onerror="this.src='path to image to be displayed if original one is not found'" src="/URL of an image">
				</td>
			</tr>
		</tbody>
	</table>

</div>

Notice height of div (800px for the sake of testing), and height of table (100% to cover whole div), then in img tag note style.

Selectors again

Details
Written by: Stanko Milosev
Category: CSS
Published: 09 December 2015
Last Updated: 09 December 2015
Hits: 4255

This time I was combining id's and classes. This is my HTML:

<div id="article" class="l-fixed">
	Article
</div>

CSS:

#article {
    width: 80%;
    float: left;
    border: 2px solid black;
}

.l-fixed#article {
    width: 600px;
}

Notice that there is no space in selectors: 

.l-fixed#article

Like this we can add class on the same element with id, otherwise, with space:

#article {
    width: 80%;
    float: left;
    border: 2px solid black;
}

.l-fixed #article {
    width: 600px;
}

I would need nested element, something like:

<div class="l-fixed">

	<div id="article">
		Article
	</div>

</div>

Simple drop down menu

Details
Written by: Stanko Milosev
Category: CSS
Published: 18 November 2015
Last Updated: 18 November 2015
Hits: 4394

Example I took from here, but from the css and html I deleted parts which are needed for beautification.

HTML should be simple:

    <ul>
        <li>
            Menu 1
            <ul>
                <li>
                    Menu 1 SubMenu 1
                </li>
                <li>
                    Menu 1 SubMenu 2
                </li>
                <li>
                    Menu 1 SubMenu 3
                </li>
            </ul>
        </li>
        <li>
            Menu 2
            <ul>
                <li>
                    Menu 2 SubMenu 1
                </li>
                <li>
                    Menu 2 SubMenu 2
                </li>
            </ul>
        </li>
        <li>Menu 3</li>
    </ul>

CSS:

ul {
    list-style: none; //I dont need bullets
    padding: 0px; //so that submenus are under main menu correctly aligned
}

ul li {
    position: relative;
    float: left;
}

li ul {
    display: none; //sub menus will not be displayed
}

li:hover ul {
    display: block; //display submenus when mouse is over
    position: absolute;
}

Real life example

  • Menu 1
    • Menu 1 SubMenu 1
    • Menu 1 SubMenu 2
    • Menu 1 SubMenu 3
  • Menu 2
    • Menu 2 SubMenu 1
    • Menu 2 SubMenu 2
  • Menu 3

How to find default font size

Details
Written by: Stanko Milosev
Category: CSS
Published: 29 October 2015
Last Updated: 29 October 2015
Hits: 4924

In Chrome browser press F12, switch to computed, click on show inherited, and scroll down until you don't find font size. Taken from here.

  1. em's and rem's
  2. More about selectors
  3. Converting pixels to percentage
  4. Shadow

Subcategories

C#

Azure

ASP.NET

JavaScript

Software Development Philosophy

MS SQL

IBM WebSphere MQ

MySQL

Joomla

Delphi

PHP

Windows

Life

Lazarus

Downloads

Android

CSS

Chrome

HTML

Linux

Eclipse

Page 150 of 163

  • 145
  • 146
  • 147
  • 148
  • 149
  • 150
  • 151
  • 152
  • 153
  • 154