Skip to main content
Inspiring
November 14, 2019
Answered

Font Not Behaving

  • November 14, 2019
  • 1 reply
  • 1297 views

I write stories and post them on my website. To avoid any formatting being brought over from my WP app Pages, I copy and paste the text into plain TextEdit then copy and paste into DW. The text defaults to stylestory from my sytlesheet. I have another font defined by stylechapter with the text-align set at center.

 

Sometimes when I highlight say Chapter One and select the stylechapter it aligns left and that is caused by the preceeding style.

The code looks like this:

<p class="stylestory"><span class="stylechapter">Chapter One</span></p>

If I remove <p class="stylestory"> then the font aligns correctly at center. Its a RPITA to go ahead and remove the preceeding font code for all the instances of Chapter. The same happens with the font styleasterisk.

 

Any idea why DW is doing this?

Thanks

Alan

This topic has been closed for replies.
Correct answer Jon Fritz

Yep, looks you have an issue in your code.


DW allows you to do things "the wrong way" maybe assuming there's going to be a script added at some point that takes care of the problem, who knows, but it allows for all sorts of "wrong" to happen within the interface.

That could be something simple like a missing ; or { in your CSS to a <table> tag in your <head> section and a whole lot more.

The point is, without seeing the code, we can only make guesses based on the very limited info we've been given. 

Right now, I would guess you have an extra or missing <span> or </span> somewhere, possibly before the section you've provided screen captures of. Have you run your code through the validatros to fix any errors you might have...

HTML: https://validator.w3.org/nu/
CSS: https://jigsaw.w3.org/css-validator/

1 reply

Jon Fritz
Community Expert
Community Expert
November 14, 2019

Could you post a link to your site so the contributors here can take a look?

Chances are good it's a combination of both the way the code is written, and the process you're using to update, that are causing your issue. I'm guessing your styles may be applied to elements that are accidentally being replaced when you paste into your pages, but it's hard to say without seeing exactly what's going on.

Inspiring
November 14, 2019

Jon

The code is generated by DW. To me it's a simple fact is that the style of the font is being taken from stylestory because it displays fine, but the alignment is being taken from the default stylestory that stylechapter is supposed to overwrite. Is it normal for the overwritten code to remail in the code string? Linking to my website won't help because the code is no different to what I see in DW. The issue is that DW is somehow retaining the alignment from the overwrittne font style. I should add that this isnt always the case. Look at the screen shots. The first is the code, the second is Design View and the third is Live View but it's not what is displayed on the webpage - the Design View is what's displayed.

Alan

Nancy OShea
Community Expert
Community Expert
November 14, 2019

What's with the <spam> tags?  You don't need them you know.   Also headings should use H tags, not P tags.  

<p class="stylestory"><span class="stylechapter">Chapter One</span></p>

 

Change it to this

<h3 class="stylestory stylechapter">Chapter One</h3>

 

or this

<h3 class="stylechapter">Chapter One</h3>

Nancy O'Shea— Product User & Community Expert