473,403 Members | 2,284 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

How can I make this bit of HTML centered between two floats?

Samishii23
246 100+
I have the following basic setup:
Expand|Select|Wrap|Line Numbers
  1. <div>
  2.  <span style="float:left;">
  3.   <span>Items</span>
  4.   <span>Items</span>
  5.   <span>Items</span>
  6.  </span>
  7.  
  8.  <span style="float:right;">
  9.   <span>Items</span>
  10.   <span>Items</span>
  11.  </span>
  12. </div>
I wanna put some HTML between the two span elements that will be in the center of both of them. But I've tried both div and span, align:center;, and I'm not sure how to do this short of using display:table; and re-organizing the my current setup.

Anyone have any ideas?
Jul 27 '11 #1

✓ answered by Rabbit

I mean this
Expand|Select|Wrap|Line Numbers
  1. <style>
  2.    div {
  3.       float: left;
  4.    }
  5. </style>
  6.  
  7. <div>column 1</div>
  8. <div>column 2</div>
  9. <div>column 3</div>
If you want them to be equally spaced, you can give the divs a width of 33%.

3 2372
Rabbit
12,516 Expert Mod 8TB
If by center you mean in between the two spans, you can just have 3 elements floated left and they will stack up right next to each other.
Jul 27 '11 #2
Samishii23
246 100+
You mean have another span float in there to create white space?
I was just hoping to have
Expand|Select|Wrap|Line Numbers
  1. +-----------------------------------------+
  2. | SPAN             SPAN               SPAN|
  3. +-----------------------------------------+
Without using a 'hack' of sorts. For example wishing there was something similar to a float: center; sort of idea I guess.
Is there something Im missing? Or is it really only "Hack"able to get this effect without using display:table;??
Jul 27 '11 #3
Rabbit
12,516 Expert Mod 8TB
I mean this
Expand|Select|Wrap|Line Numbers
  1. <style>
  2.    div {
  3.       float: left;
  4.    }
  5. </style>
  6.  
  7. <div>column 1</div>
  8. <div>column 2</div>
  9. <div>column 3</div>
If you want them to be equally spaced, you can give the divs a width of 33%.
Jul 27 '11 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Khurram | last post by:
how do i convert this HTML into CSS <html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><link rel=stylesheet HREF="styles.css" type=text/css...
15
by: Andy Fish | last post by:
Looking at an HTML document recently, I found this syntax which was completely new to me <!> <style>...</style> <!> it looks to be some kind of conditional logic but it's not in a javascript...
68
by: Steve | last post by:
Hi There, Prob a simple answer to this (I hope) but I can't quite work it out yet... I have this in a page: <map name="Map"> <area shape="rect" coords="43,68,52,77" href="map.html"...
3
by: marsandys | last post by:
Hello, I have this code below, which I am trying to have it send HTML formatted mail with embedded images. I can get this to send the mail, but it spits out a bunch of junk . I know this should...
2
w33nie
by: w33nie | last post by:
This html form that I'm using works fine, apart from that it never ends up sending any information through to my designated email. Does anyone see a problem in my code? <form...
6
by: Dan | last post by:
Hi, i defined a html table with Visible="false", but i still see it in the browser. Why and how to hide that table? Thanks Dan %@ Page Language="VB" AutoEventWireup="false"...
1
by: Summercool | last post by:
this HTML seems perfectly good but won't validate... any idea? http://www.0011.com/test_size2.html
3
by: princelindie | last post by:
Please write this html code into php echo statement. <a href="javascript:ajaxpage('test.htm', 'contentarea');">test</a>
13
by: ray | last post by:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <HTML> <HEAD> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"/ <TITLE>HTML to Text...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.