473,378 Members | 1,680 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,378 software developers and data experts.

Remove element from flow of other sibling elements

Jezternz
145 100+
Ok, I want to remove an element from the standard flow, so its location is not affected or determined by other sibling elements, the only catch is, I dont want to position it using top/left/right/bottom, I want to use a margin.
So I need to remove an element from the flow of the page. As far as I know position: fixed & absolute, make the margin property useless, so are there any other ways?

Thanks, Josh
Jul 10 '09 #1
3 6373
drhowarddrfine
7,435 Expert 4TB
Margin properties do not go away at all when using absolute or fixed.
Jul 10 '09 #2
Jezternz
145 100+
ahh ok, maybe a better description would be "Margin: auto" doesnt work.
Basicly im trying to horizontally align (As far as I know vertical alignment is not possible with css?) a div above all other objects on the page.

Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html>
  3. <head>
  4.     <style type="text/css">
  5.         *{margin: 0;padding:0;}
  6.         html, body {height: 100%;overflow: auto;margin:0;}
  7.         #center_me{margin:0 auto;width:200px;background:black;color:white;height:300px;position:fixed;}
  8.     </style>
  9.     <title>Test page</title>
  10. </head>
  11. <body>
  12.     <h1>adsada</h1>
  13.     <div id="center_me">Center me please</div>
  14.     </body>
  15. </html>
Weirdly enough in the above, static & relative center it, however they take into account the h1 :(, absolute and fixed dont center it at all.
Jul 11 '09 #3
Dormilich
8,658 Expert Mod 8TB
@Jezternz
sure you can align vertically, only it works for less cases (table cells, that is) than horizontal alignment.
Jul 11 '09 #4

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

Similar topics

8
by: MENTAT | last post by:
Hi Guys, Newbie question here. Part of my xml looks like this. <node> <description/> <config/> <log/> <transition/> <node>
2
by: Andrew Daviel | last post by:
I'd like to know how I can create a flow of 2-row elements that is resized by the browser window. I.e., I want to bind elements together (in a div, or table, or something) and then treat the...
2
by: redog6 | last post by:
I would be grateful if someone can tell me how to specify sibling elements in any order - I am using XMLSPY. Many thanks Redge
3
by: Don | last post by:
My user control has a combobox with an arraylist attached to it along with custom add and remove methods. The "Add" method is working great. However I don't understand why the "Remove" method...
1
by: Chris | last post by:
I have a problem with grouping elements in my XSL. What I want to do is select all of the distinct SCE_CGPC records, then by the FSG_SNAM records for each SCE_CGPC and then again by MOA_NAME for...
3
by: patrizio.trinchini | last post by:
Hi, how can remove sibling elements based on the value of an attribute ? For instance, gven the XML document: <root> <parentElment> <testElement name="A"> <removableElement/>
6
by: Markus | last post by:
Hello I have a navigation structured as follows: <ul> <li> <a>Chapter1</a> <ul> <li><a>Chapter 1.1</a></li> <li><a>Chapter 1.2</a></li>
1
by: adz1809 | last post by:
I have a CSS Dropdown Menu being over-lapped by other other screen elements. I've looked at z-index, but this seems to be having little effect. Any ideas welcome. cheers
1
oranoos3000
by: oranoos3000 | last post by:
hi would you please compare while position is relative and relate that with it's ancestor position and the other sibling position , and too for while position is absolute and relate that with...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...

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.