Solved

Drupal: CSS property for a a floating box

Posted on 2010-09-16
5
416 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Unordered lists (HTML ul tags) are very handy to create menus of all types, shapes and sizes.  All it takes is a little knowledge of CSS and the possibilities are endless. First off, you should know the general format for menus created using the …
Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…

690 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