Display Types for elements
<IMG>
http://www.w3schools.com/TAGS/att_img_align.asp
The <img> element is an inline element (it does not insert a new line on a page), meaning that text and other elements can wrap around it. Therefore, it can be useful to specify the alignment of the image according to surrounding elements.
<SPAN>
<P>
<p> is block element, new line, no wrapping, cannot go inside a paragraph, can go inside a <div>, its default size is 100% wide
<DIV>
To center a div in its parent
the key to getting it to work is it must have a defined width (otherwise techincally the width is defined as 100%)
<div style="width: 75%; margin: 0 auto;">center</div>
Center an Image
this will center the image because the <p> is 100% wide
<p style="text-align: center;"> <img style="margin: 10px;" src="/images/pages/home/me-and-holly-on-chisel-beach.jpg" alt="me-and-holly-on-chisel-beach" /> </p>
text-align:center; is still valid - http://www.w3schools.com/cssref/pr_text_text-align.asp - this is set in the parent element and affects the child element.
How to center an item - the modern way
{display: block; margin-left: auto; margin-right: auto} {display: block; margin: 0 auto} /* this is prefered option */
Floating is a new way of aliging stuff on a page. Floating works like the tetris game except that the blocks float upwards and you can only say wheather the blocks float to the left or the right. A floated block will float up as far as it can (ie if their is room) and then push as far as it can to the side you chose.
NB:
<br style="clear: both;" /> <!-- to be put inside block elements such as <p> & <div> --> <br style="clear: both;"> <!-- to be put inside block elements such as <p> & <div> --> <div style="clear: both;"> </div> <!-- prevents the element being eaten by wysiwyg --> <p style="clear: both;"> </p> <!-- prevents the element being eaten by wysiwyg -->
Notes about <br>, wysiwyg and clearing
The following are examples on how to put a titlesunderneath or on the side with images vertically or horizontally aligned. This sometimes does not go as easily as planned so these examples should cover all scenarios.
Inline - Horizontal lists with text centered underneath the image.
The whole logo block is centered. do i need all the centering statements. these items will stay centered and will eventually stack vertically when squashed.
<div style="text-align: center;"> <div style="display: inline-block; vertical-align: bottom; margin: 5px;"> <p style="text-align: center;"> <a href="http://www.worcester-bosch.co.uk/homeowner/boilers/find-an-installer"><img src="/images/modules/worcester-bosch-accredited-installer/worcester-bosch-registered-installer.jpg" alt="worcester-bosch-registered-installer" /></a> </p> <ul style="text-align: center; list-style-image: url('/images/common/tick.png');"> <li>Worcester Bosch Accredited Installer</li> </ul> </div> <div style="display: inline-block; vertical-align: bottom; margin: 5px; text-align: center;"> <p style="text-align: center;"><img src="/images/modules/worcester-bosch-accredited-installer/7-year-gurantee.jpg" alt="7-year-gurantee" /></p> <ul style="text-align: center; list-style-image: url('/images/common/tick.png');"> <li>7 Year Guarantee Available</li> </ul> </div> <div style="display: inline-block; vertical-align: bottom; margin: 5px;"> <p style="text-align: center;"><a href="http://www.which.co.uk/"><img src="/images/modules/worcester-bosch-accredited-installer/best-buy-which.jpg" alt="best-buy-which" width="200" height="117" /></a></p> <ul style="text-align: center; list-style-image: url('/images/common/tick.png');"> <li>Which Best Buy 2013</li> </ul> </div> </div>
All the "text-align: center" declarations are not required (as shown below) because it seems to affect all child elements, thus only 1 is required
<div style="text-align: center;"> <div style="display: inline-block; vertical-align: bottom; margin: 5px;"> <p> <a href="http://www.worcester-bosch.co.uk/homeowner/boilers/find-an-installer"><img src="/images/modules/worcester-bosch-accredited-installer/worcester-bosch-registered-installer.jpg" alt="worcester-bosch-registered-installer" /></a> </p> <ul style="list-style-image: url('/images/common/tick.png');"> <li>Worcester Bosch Accredited Installer</li> </ul> </div> <div style="display: inline-block; vertical-align: bottom; margin: 5px;"> <p"><img src="/images/modules/worcester-bosch-accredited-installer/7-year-gurantee.jpg" alt="7-year-gurantee" /></p> <ul style="list-style-image: url('/images/common/tick.png');"> <li>7 Year Guarantee Available</li> </ul> </div> <div style="display: inline-block; vertical-align: bottom; margin: 5px;"> <p><a href="http://www.which.co.uk/"><img src="/images/modules/worcester-bosch-accredited-installer/best-buy-which.jpg" alt="best-buy-which" width="200" height="117" /></a></p> <ul style="list-style-image: url('/images/common/tick.png');"> <li>Which Best Buy 2013</li> </ul> </div> </div>
Text Under Image - Horizontal and Centered
<div style="text-align: center;"> <div style="display: inline-block; vertical-align: bottom;"> <div style="display: block;"> <a href="http://www.gassaferegister.co.uk/" target="_blank" title="Gas Safe Registered Number: 562488"><img style="margin: 5px;" src="/images/modules/logos/gas-safe-white.gif" alt="" /></a> </div> <div style="display: block;"> <a href="http://www.gassaferegister.co.uk/" target="_blank">Gas Safe No: 562488</a> </div> </div> <!-- These are just logos with no text underneath --> <a href="http://www.cityandguilds.com/" target="_blank"><img style="margin: 5px;" src="/images/modules/logos/cityandguilds-logo-qualifications.png" alt="" /></a> <a href="http://www.vaillant.co.uk/" target="_blank" title="Vaillant Accredited installer"><img style="margin: 5px;" src="/images/modules/logos/vaillant_logo.png" alt="" /></a> <a href="http://www.ideal-standard.co.uk/" target="_blank"> <img style="margin: 5px;" src="/images/modules/logos/ideal-standard.jpg" alt="" /></a> </div>
The Basic Method
<div> <div><img src="/images/pages/home/group-dogs-1.jpg" alt="group-dogs-1" /></div> <div>If you’re working full time hours we can call at lunchtime and treat your dog to over an hours'.</div> </div>
Text Completely Below and Image ie cleared without floats
<p><img src="/images/pages/home/group-dogs-1.jpg" alt="group-dogs-1" /></p> <p>If you’re working full time hours we can call at lunchtime and treat your dog to over an hours'.</p> or <p> <img src="http://designingmedia.com/tonic.jpg" alt="WordPress Theme"><br> This is some content </p>
Horizontal List - with one image with a link centered underneath it.
<div style="text-align: center;"> <div style="display: inline-block; vertical-align: bottom;"> <div style="display: block;"><a href="http://www.gassaferegister.co.uk/registersearch/Engineers.aspx?businessid=127148&centreid=112514&returnurl=../FindBusiness.aspx&returnname=Find%20a%20business&reload=true" target="_blank" title="Gas Safe Registered Number: 562488"> <img style="margin: 5px;" src="/images/modules/logos/gas-safe-white.gif" alt="" /></a></div> <div style="display: block;"><a href="http://www.gassaferegister.co.uk/registersearch/Engineers.aspx?businessid=127148&centreid=112514&returnurl=../FindBusiness.aspx&returnname=Find%20a%20business&reload=true" target="_blank">Gas Safe No: 562488</a></div> </div> <a href="http://www.cityandguilds.com/" target="_blank"><img style="margin: 5px;" src="/images/modules/logos/cityandguilds-logo-qualifications.png" alt="" /></a> <a href="http://www.vaillant.co.uk/" target="_blank" title="Vaillant Accredited installer"> <img style="margin: 5px;" src="/images/modules/logos/vaillant_logo.png" alt="" /></a> <a href="http://www.ideal-standard.co.uk/" target="_blank"><img style="margin: 5px;" src="/images/modules/logos/ideal-standard.jpg" alt="" /></a> </div>
Inline Horizontally List - margin auto 0
I have not testest this method but you can see the 'margin: 0 auto;' statement is a child on the main <div>. The 'margin: 0 auto;' works on the element it is set on. The other thing to note is that the dive with the 'margin: 0 auto;' statement needs to have a defined width. You can use px, width, Max-width etc.. as long as a width is set. The reason for this is you cann center an item with no width or if the width is 100%.
<div style="margin: 0 auto; width: 80%;"> <div style="display: inline-block; vertical-align: bottom; margin: 5px;"> <p> <a href="http://www.worcester-bosch.co.uk/homeowner/boilers/find-an-installer"><img src="/images/modules/worcester-bosch-accredited-installer/worcester-bosch-registered-installer.jpg" alt="worcester-bosch-registered-installer" /></a> </p> <ul style="list-style-image: url('/images/common/tick.png');"> <li>Worcester Bosch Accredited Installer</li> </ul> </div> <div style="display: inline-block; vertical-align: bottom; margin: 5px;"> <p"><img src="/images/modules/worcester-bosch-accredited-installer/7-year-gurantee.jpg" alt="7-year-gurantee" /></p> <ul style="list-style-image: url('/images/common/tick.png');"> <li>7 Year Guarantee Available</li> </ul> </div> <div style="display: inline-block; vertical-align: bottom; margin: 5px;"> <p><a href="http://www.which.co.uk/"><img src="/images/modules/worcester-bosch-accredited-installer/best-buy-which.jpg" alt="best-buy-which" width="200" height="117" /></a></p> <ul style="list-style-image: url('/images/common/tick.png');"> <li>Which Best Buy 2013</li> </ul> </div> </div>
Float Left
This will stack the items either vertically (not level if images are different sizes) or horizontally while keeping the bottoms level (vertically aligned bottom) because floated images go up
<div style="float:left; vertical-align: bottom; margin: 5px;"> <p style="text-align: center;"> <a href="http://www.worcester-bosch.co.uk/homeowner/boilers/find-an-installer"><img src="/images/modules/worcester-bosch-accredited-installer/worcester-bosch-registered-installer.jpg" alt="worcester-bosch-registered-installer" /></a> </p> <ul style="text-align: center; list-style-image: url('/images/common/tick.png');"> <li>Worcester Bosch Accredited Installer</li> </ul> </div> <div style="float:left; vertical-align: bottom; margin: 5px;"> <p style="text-align: center;"><img src="/images/modules/worcester-bosch-accredited-installer/7-year-gurantee.jpg" alt="7-year-gurantee" /></p> <ul style="text-align: center; list-style-image: url('/images/common/tick.png');"> <li>7 Year Guarantee Available</li> </ul> </div> <div style="float:left; vertical-align: bottom; margin: 5px;"> <p style="text-align: center;"><a href="http://www.which.co.uk/"><img src="/images/modules/worcester-bosch-accredited-installer/best-buy-which.jpg" alt="best-buy-which" width="200" height="117" /></a></p> <ul style="text-align: center; list-style-image: url('/images/common/tick.png');"> <li>Which Best Buy 2013</li> </ul> </div>
margin 0 auto - vertically stacked and centered
If you dont want to use <li> method, you can replace this with a <div> or <p>
<div style="margin: 0 auto; padding: 5px;"> <p style="text-align: center;"> <a href="http://www.worcester-bosch.co.uk/homeowner/boilers/find-an-installer"><img src="/images/modules/worcester-bosch-accredited-installer/worcester-bosch-registered-installer.jpg" alt="worcester-bosch-registered-installer" /></a> </p> <ul style="text-align: center; list-style-image: url('/images/common/tick.png');"> <li>Worcester Bosch Accredited Installer</li> </ul> </div> <div style="margin: 0 auto; padding: 5px;"> <p style="text-align: center;"><img src="/images/modules/worcester-bosch-accredited-installer/7-year-gurantee.jpg" alt="7-year-gurantee" /></p> <ul style="text-align: center; list-style-image: url('/images/common/tick.png');"> <li>7 Year Guarantee Available</li> </ul> </div> <div style="margin: 0 auto; padding: 5px;"> <p style="text-align: center;"><a href="http://www.which.co.uk/"><img src="/images/modules/worcester-bosch-accredited-installer/best-buy-which.jpg" alt="best-buy-which" width="200" height="117" /></a></p> <ul style="text-align: center; list-style-image: url('/images/common/tick.png');"> <li>Which Best Buy 2013</li> </ul> </div>
Text Under Image - Vertically Stacked
<div style="float: left; width: 150px; margin-right: 40px;"> <div> <div style="display: inline-block;"><a href="http://www.hormann.co.uk" target="_blank"><img src="/../images/hormann.gif" alt="image 1" /></a></div> <h5 style="text-align: center;">Hormann</h5> </div> <div> <div style="display: inline-block;"><a href="http://www.gliderol.co.uk/" target="_blank"><img src="/../images/gliderol.gif" alt="image 2" /></a></div> <h5 style="text-align: center;">Gliderol</h5> </div> <div> <div style="display: inline-block;"><a href="http://www.domesticrollershutters.co.uk/" target="_blank"><img src="/../images/domestic-rollers-logo.jpg" alt="image 2" /></a></div> <h5 style="text-align: center;">Domestic Rollers</h5> </div> </div>
Images with title on the right side vertically centered
<div> <div style="display: inline-block;"><img src="/images/modules/logo-block/logo-200px-high.png" alt="" /></div> <!-- Method 1 --> <div style="display: inline-block; height: 20px; margin: auto auto;">Method 1</div> <!-- Method 2 --> <div style="display: inline-block; height: 100%;"> <p style="display: block; margin: auto auto;">Method 2</p> </div> </div>
The following examples and layouts use the 'overflow:hidden' feature to prevent text wrapping and to allow nice and neat listings whilst keeping them responsive. The examples all comprise of 2 columns. You can either choose to have trhe image on the right or left without issue.
Consider putting the clear both in the <h2> title rather thatn a seperate <div style="clear: both;"> </div> - This makes it neater and one less line. Not having the <div> at the end also prevents the text getting cycled in <div>'s rather than <p>'s.
HTML
<div style="overflow: hidden;"> <img style="margin: 10px; float: right;" src="/images/pages/dog-sitting/arnside.jpg" alt="arnside" /> <p style="overflow: hidden; min-width: 180px;">Your dog can stay with us at my home. They will be treated just like a member of our family with</p> </div>
Item/Article list (ie rooms) image on the left, minimum width for the item to prevent content/text block wrapping and splitting lines (responsive)
HTML
<div style="overflow: hidden;"> <img style="margin: 10px; float: left;" src="/images/pages/home/group-dogs-1.jpg" alt="group-dogs-1" /> <p style="overflow: hidden; min-width: 180px;"> If you’re working full time hours we can call at lunchtime and treat your dog to over an hours’ worth of exercise and companionship to break up the day. If the mornings are hectic or your dog is young and just can’t wait then maybe our morning walk is for you. I walk in the afternoon too giving you real flexibility if you work shifts or have a busy afterschool schedule. Walkies works Mon to Fri but book only the days you need. Five days a week or five days a year, once you have registered I’m happy to take your dog even when it’s a last minute emergency. Weekends are by arrangement.<br style="clear: both;" /> </p> </div>
Item/Article list (ie rooms) image on the left, minimum width for the item to prevent content/text block wrapping and splitting lines (responsive)
HTML
<div style="overflow: hidden;"> <img style="margin: 10px; float: left;" src="/images/pages/home/group-dogs-1.jpg" alt="group-dogs-1" /> <p style="overflow: hidden; min-width: 180px;"> If you’re working full time hours we can call at lunchtime and treat your dog to over an hours’ worth of exercise and companionship to break up the day. If the mornings are hectic or your dog is young and just can’t wait then maybe our morning walk is for you. I walk in the afternoon too giving you real flexibility if you work shifts or have a busy afterschool schedule. Walkies works Mon to Fri but book only the days you need. Five days a week or five days a year, once you have registered I’m happy to take your dog even when it’s a last minute emergency. Weekends are by arrangement. </p> </div> <div style="clear: both;"> </div>
NB: <p style="overflow: hidden; min-width: 180px;"> can be replaced with <div style="overflow: hidden; min-width: 180px;">. This has the benefits of extra spacing that comes with <p> not being applied. However if you use <div>, text will also need to be encapsulated in a <p>. See the following methods.
HTML
<div style="overflow: hidden;"> <img alt="" src="/images/dog-picture.jpg" style="float:left; margin: 10px;"/> <div style="overflow: hidden; min-width: 180px;"> <h2>This is a Title</h2> <p>This is a paragraph of Text</p> <ul class="list-number-digit digit-brown"> <li>We are located in the heart of historic Branston on the main Lincoln Road.</li> <li>Just 10 minutes South East of Lincoln.</li> <li>We have a large selection of quality Guest Beers, Largers, Bitters, Spirits, Soft drinks and Snacks.</li> <li>We also have a long history of serving the community through a number of local and National Charities.</li> <li>If you have any questions please don't hesitate to call us.</li> </ul> <p>Another Paragraph of text (optional)</p> </div> </div>
<li> and content with imageshow on the right, text area has mimimum width to prevent text wrapping (responsive)
NB: in this example i set imageshow to 419px width X 336px height, Theme Slider
HTML
<div style="overflow: hidden;"> <div style="float: right; margin: 10px;">{imageshow sl=1 sc=1 /}</div> <div style="overflow: hidden; min-width: 180px;"> <h2>This is a Title</h2> <p>This is a paragraph of Text</p> <ul class="list-number-digit digit-brown"> <li>We are located in the heart of historic Branston on the main Lincoln Road.</li> <li>Just 10 minutes South East of Lincoln.</li> <li>We have a large selection of quality Guest Beers, Largers, Bitters, Spirits, Soft drinks and Snacks.</li> <li>We also have a long history of serving the community through a number of local and National Charities.</li> <li>If you have any questions please don't hesitate to call us.</li> </ul> <p>Another Paragraph of text (optional)</p> </div> </div>
Minimum width for the item to prevent title wrapping and splitting lines (responsive)
http://www.inchrye.co.uk/rooms
HTML
<p>Our Rooms at Inchrye Bed and Breakfast are all well maintained but retain a homely feel so you can enjoy your stay in Inverness like it was your own back garden. We have a wide variety of room sizes to suite all family sizes.</p> <p><img alt="Suite Room with Double Bed and own Sitting Room" class="frame-2" src="/images/rooms/suite-room.jpg" style="float: left; margin-left: 15px; margin-right: 15px;" title="Suite Room with Double Bed and own Sitting Room" /></p> <p style="float: left; min-width: 180px;"><strong>Suite Room with Double Bed and own Sitting Room</strong></p> <div style="clear: both;"> </div>
HTML - Easy Version
<p><img style="float: left;" src="/images/pages/home/white-scomadi.jpg" alt="white-scomadi" width="327" height="260" /></p> <div style="float: left;"> <p>Turismo Leggera</p> <p> The Turismo Leggera range represents the<br />culmination of 10 years of prototype development.<br />Utilising the experience of Scooter Innovation & PM<br />Tuning Racing Products, Scomadi are aimed at<br />providing a new era in scootering for followers of<br />iconic Italian design.<br />With styling cues taken from the Grand Prix model<br />the goal was to create a "Modern Classic".<br />A machine that allows the true enthusiast to retain<br />classic styling without sacrificing reliability or<br />modern day functionality. The Turismo Leggera 250<br />was initially released as a carbon fibre,10 machine<br />limited edition hand built in the UK.<br />Demand for further machines evolved into another<br />30 handmade 300cc machines with the latest mass<br />production series of Scomadis presented today.<br />The Turismo Leggera range will present a dynamic<br />package for the discerning scooterist available<br />firstly as air cooled 50cc and 125cc engine options<br />with a flagship model 300cc due for mid 2014.<br />The Scomadi TL300 will be equipped with the Piaggio<br />“class leader”: QUASAR- 300, 4 valve, liquid cooled,<br />engine. One of the lightest, most compact, and<br />powerful 300cc motors on the market. Powered by<br />22HP at 7,500 rpm. The TL300 ensures top<br />performance in terms of speed and acceleration with<br />reliability. </p> </div>
HTML - Image on alternating side, float left then float right
http://www.sidescansystems.com/brite-side-scan-system
<p> The system consists of 4 Ultrasonic sensors mounted down the left side fo the vehicle and a warning display mounted in the cab. When the left hand indicator is on the unit will sense the presence of a cyclist, pedestrian or vehicle and give its posistion and range up to 1.5 mtrs. At the same time, a spoken voice warning is played saying "This vehicle is turning left" to warn anyone on the nearside. </p> <p> </p> <p style="text-align: right;"><img alt="Side Scan Kit" class="frame-2" src="/images/side-scan-kit.jpg" style="float: right;" title="Side Scan Kit" /></p> <p style="margin-left: 80px;"><strong>Features</strong></p> <ul class="tick" style="margin-left: 80px;"> <li>4 x Ultrasonic Sensor with 1.5 mtr range</li> <li>In cab warning unit which displays range and position</li> <li>98db Voice Sounder - "This vehicle is turning left"</li> <li>IP68 Waterproof rated</li> <li>12v-24v operation</li> <li>Can be fitted to almost any vehicle</li> <li>Low speed sensing - shuts off at higher speeds</li> </ul> <div style="clear: both;"> </div> <p> </p> <p><img alt="Choice of Sensors" class="frame-2" src="/images/choice-of-sensors.jpg" style="float: left; margin-left: 15px; margin-right: 15px;" title="Choice of Sensors" /></p> <p> <strong>Choice of sensors - Underslung or Flush Mount</strong><br /> (Depending on application) </p> <div style="clear: both;"> </div>
These are some notes that i used when creating these code samples.
You can use any image for a list bullet as shown below but they must be small enought to fit otherwise the text will become out of alignment with the icon. If you want to use larger images you need to use a different method.
HTML
<ul style="margin-left: 40px; list-style-image: url('/images/kb/2014/498/lists-with-large-custom-icons-that-are-vertically-aligned/tick.png');"> <li>Single room with bed and breakfast £30 per person</li> <li>Double Room with bed and breakfast £35 per person</li> <li>(All Prices shown above are per night)</li> <li>(All rooms are en Suite)</li> </ul>
This method sets a separate icon for each <li> item although you can set a global icon in the <ul>. When you do this the text in the <li> is moved out of horizontal alignment with the icon so it looks messey. To fix this I have surrounded the 'text'/'the whole on the <li> contents' and then I have used a position: relative and top: -10px statement to move the text back into the center of the icons. You now have a nice looking list with large custom icons. The position: relative in the <ul> is important for this to work. You can also put all of the styling into a CSS file if you want.
HTML
<ul style="margin-left: 40px; position: relative;"> <li style="list-style-image: url('/images/kb/2014/498/small-icons/wi_fi_32.png');"><span style="position: relative; top: -10px;">Wi-Fi</span></li> <li style="list-style-image: url('/images/kb/2014/498/small-icons/coffee_maker_32.png');"><span style="position: relative; top: -10px;">Tea and Coffee</span></li> <li style="list-style-image: url('/images/kb/2014/498/small-icons/television_32.png');"><span style="position: relative; top: -10px;">TV</span></li> <li style="list-style-image: url('/images/kb/2014/498/small-icons/towel_32.png');"><span style="position: relative; top: -10px;">Fresh Towels</span></li> <li style="list-style-image: url('/images/kb/2014/498/small-icons/bulls-eye-eggs-with-toast-and-bacon_32.png');"><span style="position: relative; top: -10px;">Our stay includes a traditional English breakfast.</span></li> <li style="list-style-image: url('/images/kb/2014/498/small-icons/corn_flakes_32.png');"><span style="position: relative; top: -10px;">We also have a variation of cereals and fruits available.</span></li> </ul>
grid layout works by splitting the width up by % but on 'mobile' devices, grids fallback to 1 vertical column. Thi sis not ideal in all situations but is an option.
HTML
<div class="grid-layout"> <div>Text in column 1</div> <div>Text in column 2</div> </div>
This is method is really useful for making horizontal menus. You can make all of the items appear on the same line if you make the <ul> wider. I have not tried playing with min-width and max-width but they should work.
HTML
<ul> <li>Electrician in Kent</li> <li>Electrician in Canterbury</li> <li>Electrician in Dover</li> <li>Electrician in Ashford</li> </ul>
CSS
ul { list-style: none; margin: 0 auto; width: 400px; padding: 0; } li { float: left; }
HTML
<ul style="list-style: none;"> <li style="display: inline;">Solar Thermal Panels in Lincolnshire</li> <li style="display: inline;">Ground Heat Source Pumps in Lincolnshire</li> <li style="display: inline;">Wind Turbine Installations in Lincolnshire</li> <li style="display: inline;">Renewable Energy Services in Lincolnshire</li> <li style="display: inline;">Solar Photovoltaic Panels in Lincolnshire</li> <li style="display: inline;">All Ways Green Ltd</li> </ul>
or
CSS
.centered-list li { float: left; list-style: none outside none; padding: 5px; }
HTML
<ul class="centered-list"> <li>Electrician in Kent</li> <li>Electrician in Canterbury</li> <li>Electrician in Dover</li> <li>Electrician in Ashford</li> </ul> <div style="clear: both;"> </div>
you can also use the line below instead of inline CSS
<li style="float: left; list-style: none outside none; padding: 5px;"></li>
This is a basic horizontal list using <div>
HTML
<div style="text-align: center; valign: top; background-color: white;"> <div style="width: 150px; display: inline-block;"> <a title="City and Guilds NPTC" href="http://www.nptc.org.uk/" target="_blank"> <img src="/images/modules/498/medium-icons/city-and-guilds-nptc.jpg" alt="City and Guilds NPTC" /> </a> </div> <div style="width: 150px; display: inline-block;"> <a title="International Society of Arboriculture" href="http://www.isa-arbor.com/" target="_blank"> <img src="/images/modules/498/medium-icons/international-society-of-arboriculture.jpg" alt="International Society of Arboriculture" /> </a> </div> <div style="width: 150px; display: inline-block;"> <a title="Constuction Line" href="http://www.constructionline.co.uk/" target="_blank"> <img src="/images/modules/498/medium-icons/constuction-line.png" alt="Constuction Line" /> </a> </div> <div style="width: 150px; display: inline-block;"> <a title="Acclaim Accreditation" href="http://www.constructionline.co.uk/static/acclaim/" target="_blank"> <img src="/images/modules/498/medium-icons/acclaim-accreditation.png" alt="Acclaim Accreditation" /> </a> </div> </div>
CSS
<style type="text/css"> .qw-list { overflow: hidden; } .qw-list ul { list-style: none; position: relative; float: left; display: block; left: 50%; } .qw-list ul li { position: relative; float: left; display: block; right: 50%; } </style>
HTML
<div class="qw-list"> <ul> <li>Electrician in Kent</li> <li>Electrician in Canterbury</li> <li>Electrician in Dover</li> <li>Electrician in Ashford</li> </ul> </div>
CSS
<style type="text/css"> ul.qw-divmenu { width: 75%; margin: 0 auto; padding: 0; list-style: none; } ul.qw-divmenu li { display: inline-block; } </style>
HTML
<ul class="qw-divmenu"> <li>Electrician in Kent</li> <li>Electrician in Canterbury</li> <li>Electrician in Dover</li> <li>Electrician in Ashford</li> </ul>
I came across this method at WebFusion where they took a clever method for making list with images by using ordered and unoredered lists and replacing the bullet point wiht an image.
So this method will requires some html code and some CSS code. The CSS code could be inline if you needed.
CSS
ul.icon_list { list-style: none; } .icon_list li { margin-top: 0px; margin-right: 0px; margin-bottom: 18px; margin-left: 0px; } .medium .customised { /*background-position: 0px -4695px;*/ } .medium .flexible { /*background-position: 0px -4895px;*/ } .icon_list.medium li { padding-left: 60px; background-color: transparent; background-image: url("images/modules/498/small-icons/television_32.png"); background-repeat: no-repeat; background-attachment: scroll; /*background-position: 0px 5px;*/ background-clip: border-box; background-origin: padding-box; background-size: auto auto; }
This CSS code utilises image sprites but can easily be adapted to use normal images
HTML
<ul class="icon_list medium green"> <li class="customised"> Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. </li> <li class="flexible"> Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. </li> </ul>
Address: 198 Example street, Suite 7s new York, NY 10013
Phone: 112 345 6798
Email: example@email.com
CSS
.fu-list li { clear: both; margin: 15px 0 0; padding-bottom: 0; list-style-type: none; list-style-position: outside; } .fu-list .fu-icon-wrapper { width: 20px; height: auto; line-height: 24px; margin: 1px 10px 0 0; z-index: 9; text-align: center; /* evens all the icons up */ float: left; } .fu-list .fu-icon-wrapper i[class*="fa"] { font-size: 18px; display: block !important; color: #000; } .fu-list .fu-content { overflow: hidden; /* this prevents the text flowing under the icon */ } .fu-list .fu-content p { padding: 0; margin: 0; }
HTML
<ul class="fu-list"> <li> <div class="fu-icon-wrapper"><i class="fa fa-map-marker"></i></div> <div class="fu-content"><p>Address: 198 Example street, Suite 7s new York, NY 10013</p></div> </li> <li> <div class="fu-icon-wrapper"><i class="fa fa-mobile"></i></div> <div class="fu-content"><p>Phone: 112 345 6798</p></div> </li> <li> <div class="fu-icon-wrapper"><i class="fa fa-envelope"></i></div> <div class="fu-content"><p>Email: <a href="mailto:example@email.com">example@email.com</a></p></div> </li> </ul> <div style="clear: both;"> </div>
Notes
This is a really nice solution to having icons in a list.
CSS
.product-list { font-family: wf_segoe-ui_normal, 'Segoe UI', Segoe, 'Segoe WP', Tahoma, Verdana, Arial, sans-serif; font-size: 100%; } .product-list ul { list-style: none; list-style-type: none; margin: 0; padding: 0; } .product-list li { margin: 0; padding: 0; line-height: 1.25; display: block; margin: 0 0 0.75em; font-size: 1em; } .product-list li.heading { font-size: 1em; font-weight: normal; margin-bottom: 0.65em; } .product-list .product-link { } .product-list li a { color: #1A1A1A; font-size: 0.9em; font-size: 1em; cursor: pointer; text-decoration: none; height: 10px; vertical-align: top; } .product-list li img { display: inline-block; height: 26px; width: 26px; margin-bottom: -0.45em; margin-right: 10px; max-width: 100%; border: none; } .product-list li img.product-left { float: left; } @screen and (min-width: 540px;) { .product-list ul:first-child { margin-top: 0em; } }
HTML
<div class="product-list"> <ul> <li class="heading">Product List Title</li> <li><a target="_self" class="product-link" href="http://quantumwarp.com/">Example Product 1<img src="/images/modules/498/medium-icons/city-and-guilds-nptc.jpg" class="product-image product-left" alt="logo"></a></li> <li><a target="_self" class="product-link" href="http://quantumwarp.com/">Example Product 2<img src="/images/modules/498/medium-icons/city-and-guilds-nptc.jpg" class="product-image product-left" alt="logo"></a></li> <li><a target="_self" class="product-link" href="http://quantumwarp.com/">Example Product 3<img src="/images/modules/498/medium-icons/city-and-guilds-nptc.jpg" class="product-image product-left" alt="logo"></a></li> <li><a target="_self" class="product-link" href="http://quantumwarp.com/">Example Product 4<img src="/images/modules/498/medium-icons/city-and-guilds-nptc.jpg" class="product-image product-left" alt="logo"></a></li> <li><a target="_self" class="product-link" href="http://quantumwarp.com/">Example Product 5<img src="/images/modules/498/medium-icons/city-and-guilds-nptc.jpg" class="product-image product-left" alt="logo"></a></li> </ul> </div>
Just like PHP (ie php.ini), phpMyAdmin also has its own execution time limit. Why? I dont know.
You are most likely to see an error like the one below:
Fatal error: Maximum execution time of 60 seconds exceeded in C:\xampp\phpmyadmin\libraries\dbi\mysql.dbi.lib.php on line 140
To increase the phpMyAmin execution time, you need to edit the file
Add this line to xampp\phpmyadmin\config.inc.php
$cfg['ExecTimeLimit']=6000;
You might also want to change the settings below in the normal php.ini file if you still are getting timeout errors.
And Change xampp\php\php.ini to
post_max_size =750M
upload_max_filesize =750M
max_execution_time =5000
max_input_time =5000
memory_limit =1000M
And change xampp\mysql\bin\my.ini
max_allowed_packet =200M
Example 1
#contact #center_column p {margin:0; padding:0 0 10px 0;} #contact fieldset p {padding-left: 60px;} /* correct drop down placement */
Even thought the padding-left is after, the first line take presidence because it is further down the element chain. so line 1 will apply.
Example 2
#contact #center_column p {margin:0; padding:0 0 10px 0;} #contact #center_column fieldset p {padding-left: 60px;} /* correct drop down placement */
In this example line 2 will be applied because the are at the same element level, but then line 2 is after line 1 so is applied as you normally expect css to work.
Full Syntax
{nicepaypal:button type|amount|item name|item number|shipping|shipping2|tax|item quantity|weight|option1|option2}
Real World Examples
{nicepaypal:cart|79.99|Custom Teeth Whitening Trays|||||field;Enter Quantity;1;3||} <p>{nicepaypal:cart|79.99|Custom Teeth Whitening Trays|||||field;<strong>Enter Quantity</strong>;1;}</p>
To prevent version of Joomla being identified. A way to check if you're running a Joomla site and what version by what files and directories are present. Also will prevent Blind Elephant working. One of the easiest ways for an attacker to decide if your site is a potential Joomla! target is to perform a rudimentary visual fingerprinting.
Template Issues, Deny these links via htaccess
* You should also remove (if not needed) the default joomla images. Presence of Certain default files and folders can ID the Joomla Version. Delete the following:
Directories:
Files:
Other Fingerprinting
Error Reporting to None
Prevents any minor glitch to reveal sensitive server configuration information to a potential hacker). If this doesn't work, disabling PHP's error output to the browser in the php.ini. Leaving Error Reporting set to anything else except NONE will slow down your website and give hackers a security hole that they can use to peer into your server settings and PHP environment. Turn it off (NONE) unless you are debugging at the moment. Only use Error Reporting while testing or debugging. Otherwise keep it turned off.
robots.txt is a security nightmare.
- create deny lists for certain folders. better than identifying them in robots.txt
- Think twice about what you put in your robots.txt, since this is a common source for attackers to find interesting URLs
- ideally - make everything dissallowed and then add exceptions. this will not show what folders are there
if suhosin patch is installed this can cause unxplained issues where stuff will not run. it cannot be disabled by users but can be put in simulation mode (same thing)
find extension="suhosin.so" and add the following line below to give
extension="suhosin.so"
suhosin.simulation="On"
This useful article shows you what parts of a URL you can build with .htaccess server environmental variables.
Below I have named the various parts of a URL and given the corresponding global PHP variable. This is not an exahstive list as you can get usrrname passwords from a URL
https://user123:password1@video.quantumwarp.com:8080/subfolder/subfolder2/index.php?turnip=51&alien=54#myniceheading 1 2 3 4 5 6 7 8 9 10 ## PHP Variables ## $_SERVER['SERVER_PROTOCOL'] 1-2 (:// is not included) $_SERVER['HTTPS']; (This is a Boolean) $_SERVER['PHP_AUTH_USER'] 2-3 $_SERVER['PHP_AUTH_PW'] 3-4 (: and @ are not included) $_SERVER['SCRIPT_NAME']; 4-8 $_SERVER['PHP_SELF']; 4-8 $_SERVER['HTTP_HOST']; 4-6 $_SERVER['SERVER_NAME']; 4-6 $_SERVER['SERVER_PORT']; 6-7 (: is not included) $_SERVER['REQUEST_URI']; 7-10 (fragment might not be included) $_SERVER['QUERY_STRING']; 8-9 (? is not included) ## Part Names ## Protocol 1-2 Username 2-3 Password 3-4 Sub Domain 4-5 Domain 5-6 Port 6-7 Path 7-8 Query 8-9 Fragment 9-10 (some might refer to this as an Anchor)
To change the database prefix to prevent SQL Injection Attack (if not done during install)
Backup your database and site first.
Newer version of PHPMyAdmin have a table prefix changer inbuilt and is now the prefered method.
Taken from here