HTML如何让文本两端对齐

html-css05

HTML如何让文本两端对齐,第1张

<p style="text-align:justifytext-justify:inter-ideograph>HTML如何让文本两端对齐HTML如何让文本两端对齐HTML如何让文本两端对齐HTML如何让文本两端对齐HTML如何让文本两端对齐HTML如何让文本两端对齐</p>

text-align:justify:这是文本对齐标签只是英文字体有效果,中文字体没有作用,如果想中文也能两端对齐就加上text-justify:inter-ideograph。

一、文字两端对齐,首行缩进两个字符

可以这样写:

.content { text-align:justifytext-justify:inter-ideographword-wrap:break-wordword-break:break-alltext-indent:2em}

二、写一个JavaScript函数,计算1到100立方和,输出到文档(documengt.write)中

函数如下

function cubesum()

{

var sum=0,i=0

for(i=1i<=100i++){

sum=sum+i*i*i

}

document.write(sum)

}

希望能帮上你的忙