Avatar of bogorman
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
</div>
</div>

#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)?
Drupal

Avatar of undefined
Last Comment
bogorman

8/22/2022 - Mon
nanharbison

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.
bogorman

ASKER
Hi,
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.
Brian
nanharbison

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 theme.info 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
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
bogorman

ASKER
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
</div>
</div>

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.
nanharbison

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.
bogorman

ASKER
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:

Current

Magazine

Contents

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.
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
ASKER CERTIFIED SOLUTION
bogorman

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
bogorman

ASKER
Because the question wasn't answered