Solved

Drupal: CSS property for a a floating box

Posted on 2010-09-16
5
408 Views
Last Modified: 2012-05-10
On my website, that is made in drupal, I have a special area that contains language options and the login button. (top right area)

http://www.0815-taschen.de/

My question is, how do I make it float relative to the top header? so it dosent fly out of the header, Currently it's relative to the right, but as the window is resized the location changes. I understand this would be easy, but with Drupal as I am modifying the template and creating a new location(Its in a block) I can't just drop them in the template next to the logo.

My css:
#top_content {
	
	color:#03C;
	padding:5px;
	position:absolute;
	right:100px;
   
	top: 0px;
	width:150px;
	line-height: 10px;
	font-size:12px;
	
	text-align:right;
	height:20px;
	}

Open in new window






The page.tpl.php area looks as such:
</head>
<body class="<?php print $body_classes; ?>"><div id="top_content" class="top_content"><?php print $top_content ?></div>


  <div id="page">

Open in new window

0
Comment
Question by:deterius
  • 2
  • 2
5 Comments
 
LVL 30

Accepted Solution

by:
LZ1 earned 167 total points
ID: 33691474
Put the top_content div inside of the <div id="page">  but after <div id="header"> and <div id="header_inner">.  Then you should be able to float it right.
0
 
LVL 17

Assisted Solution

by:Thomas4019
Thomas4019 earned 333 total points
ID: 33692237
You can make you own custom regions where ever you want in your theme.
0
 

Author Comment

by:deterius
ID: 33698432
thanks for the comments, so update: first of- "top_content div is a new custom region, however putting it in to "<div id="page">  but after <div id="header"> and <div id="header_inner">" didn't change much- moreover, I've added a containting div that contains the top_content div and added color backgrounds to show where they are.. BUT I can only see them when I am logged in!

They don't show up to anonymous users! Why?
0
 
LVL 17

Assisted Solution

by:Thomas4019
Thomas4019 earned 333 total points
ID: 33698478
Might be a caching issue, kind of out of my league here. Try pressing Ctrl + F5

I think this should make your life easier,
http://css-tricks.com/absolute-positioning-inside-relative-positioning/
0
 

Author Closing Comment

by:deterius
ID: 34010770
Vague, not expert answer. Not even good understanding of a good issue - they should have asked questions to provide a good answer.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

So you have coded your own WordPress plugin and now you want to allow users to upload images to a folder in the plugin folder rather than the default media location? Follow along and this article will show you how to do just that!
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now