Link to home
Start Free TrialLog in
Avatar of bogorman

asked on

Formatting text so it is vertically aligned

I am using drupal 7.
I have created a content section for my frontpage using a mini-panel with three regions in a row.
The left hand region contains content defined by a content type (only 1 field: body)
The centre region contains an image, again content defined by a content type.
The right-hand region contains content defined by various views.
I need the text in the left hand region to be vertically aligned and left aligned.
I believe I can do it by using this coding:

<div id="floater">
<div id="content">
      Content here

#floater      {float:left; height:50%; margin-bottom:-120px;}
#content      {clear:both; height:240px; position:relative;}

(obtained from: Lost in the Woods Blog)

How can I make this "user-friendly" so that users with limited knowledge of html/css can simple enter the text and it will automatically be centered vertically?   Suppose it means creating a template file for the content type but how  can I insert the html coding into it (assuming this is the best way)?
Avatar of nanharbison
Flag of United States of America image

Are you using the ckeditor module? It allows text to be centered, the way you center text in a Word document. Centainly everyone knows how to do that by now.
Avatar of bogorman


Yes, I realise that I can use ckeditor but it is centering VERTICALLY which I want to do and I don't think you can do that using the editor buttons. I want to avoid inexperienced users having a problem.
You could add a CSS file to the theme and add the elements you need to this so they will always apply. Do you know how to add a CSS file to your theme?
On the file, you find the CSS files attached like this:
stylesheets[all][] = css/common.css
stylesheets[all][] = css/links.css
stylesheets[all][] = css/typography.css
stylesheets[all][] = css/forms.css

so you can add your own to this:
stylesheets[all][] = css/your.css
Yes, I know how to do that but it is the HTML coding that I am concerned about:

<div id="floater">
<div id="content">
      Content here

I know I can add it to the Body using ckeditor but want to "hide" it from users so that they will not accidentally delete some of it.
Can I add it to a template for this content type? If so, how? I know little about php.
So you mean you want to ADD these divs to the page? I didn't understand that, I thought you just meant you wanted to style these divs.
I am not sure you could do this with a content type, but how about adding a block to the page, and styling that in your CSS to show the way you want them too. When you create a block, there are always a few levels of divs containing the text.
Not sure what you mean by "adding  a block to the page".
Ideally what I want to do is, when the user creates content using a particular content type they enter, say:




and save the content, when it appears it will be centered vertically. So the user does not see any of the coding. I thought one should be able to add the html coding by "coding it in" to the template for the content type using php.
Avatar of bogorman

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Because the question wasn't answered