简体   繁体   English

格式标签HTML PHP CSS

[英]Formatting tabs HTML PHP CSS

I've been away from programming in general for a long time. 我已经很长时间没有编程了。 Amazing how you forget the simplest things. 令人惊讶的是您忘记了最简单的事情。 So I'm trying to warm-up my web design/PHP by making a resume generator. 因此,我试图通过制作简历生成器来预热我的Web设计/ PHP。 I made my resume in Word, and I want to try to mimic the document formatting. 我在Word中制作了简历,我想尝试模仿文档格式。

I tried doing this with tables, and then I scraped that because it wasn't working exactly like I wanted, and now I'm using divs and spans. 我尝试使用表来执行此操作,然后我将其刮掉了,因为它无法完全按照我的要求工作,现在我正在使用div和spans。

But that's breaking the formatting even more so I don't know what to do... 但这甚至进一步破坏了格式,所以我不知道该怎么办...

My main problem is getting spaces to line up precisely the way tabs do in Microsoft Word, on the same line as other things. 我的主要问题是要获得空间来准确对齐选项卡在Microsoft Word中的方式,与其他方式在同一行上。

Here is the code I'm using 这是我正在使用的代码

function fieldFill($fieldL, $fieldR = 'NoneAtAll'){
$numOfSpaces = 50;
echo '<div class="left">' . $fieldL . '</div>';

//if ($fieldR != 'NoneAtAll'){
//    for($i = 0; $i <= $numOfSpaces - strlen($fieldL); $i++){
//        echo '&nbsp';
//        //echo $i;
if ($fieldR != 'NoneAtAll'){
        for($i = 0; $i <= $numOfSpaces; $i++){
            echo '&nbsp';
        }
    echo '<span class="rightt">' . $fieldR . '</span>';
    echo '<br></br>';
    }
}

And here is the CSS section 这是CSS部分

<style>
    .rightt {margin: 0 0 0 300px;}
    .name { font-size: 22pt;}
    .sections {
        padding: 15px 0px 0px 0px;
        font-size: 12pt;
        font-weight: bold;
        text-decoration: underline;
        }
    .years {
        font-size: 12pt;
        font-weight: bold;
        /*white-space:pre*/
        }
    .jobtits {
        font-size: 12pt;
        font-weight: bold;
    }
    </style>

I know there's already good resume generators out there but I'm doing this for the practice. 我知道那里已经有不错的简历生成器,但是我正在为此做练习。 Thanks 谢谢

Here we go, I want to mimic this format 我们走了,我想模仿这种格式

在此处输入图片说明

As of today I'm finding that this code 从今天开始,我发现这段代码

<div id="page-container">
            <div id="leftside">
                <div class="name">Name</div>
                Address
                <br>
                City
                <br>
                State

                <div class="sections">Objective</div>
                To do good stuff!
                <div class="sections">Education</div>
                A college    
                <div class="sections">Awards</div>
                Did some good stuff
                <div class="sections">Job Experience</div>
                <div class="jobtits">Some place</div>
                Was an editor
                <div class="jobtits">Another place</div>
                Did stuff there too.
                <div class="sections">Skills</div>
            </div>
            <div id="rightside">
                <div class="name">That's my name</div>
                Mobile: 334-223-3244
                <br>
                Home: 334-223-3244
                <br>
                Email: Email@me.com

                <div class="sections">Filler</div>
                Filler
                <div class="sections">Filler</div>
                2012-1030    
                <div class="sections">Filler</div>
                Filler
                <div class="sections">Job Experience</div>
                <div class="jobtits">Jul 00 - 32</div>
                Filler
                <div class="jobtits">Everybody's heard</div>
                About the bird.
                <div class="sections">Skills</div>
            </div>
        </div> 

is working for the most part, but there are still parts that need to overlap, such as the objective line. 在大多数情况下都是有效的,但是仍然有一些部分需要重叠,例如目标线。 I probably need to make a new div/table for that huh? 我可能需要为此创建一个新的div /表? I'm walking through the html static before making it dynamic. 我正在遍历html静态,然后使其动态化。

SPAN标签是内联元素,因此边距不会被覆盖,请改用DIV标签。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM