none
creating an inline style RRS feed

  • Question

  • I want to create an inline style for a div. I have the style application toolbar visible and I have it set to manual with a target rule of New Inline Style.

    I select the div I want to style. I click on NEW STYLE in the apply styles pane, check the "apply new style to document selection" (the div that I have selected) and create the style. But, when I click OK to apply the style, EW3 creates a new class (.newStyle1) and applies the class to my div.

    I don't want to create a style class, I want an inline style applied to the div I have selected.

    Where am I going wrong?

    An update - I found that I must select (inline style) in the selector window of the new style dialog box and that does the trick. But what is the point of the style application toolbar being set to inline style if I have to specify it a second time in the new style dialog box?

    Tuesday, June 8, 2010 7:41 PM

Answers

  • Work in code view if you want an inline style automatically. Put your cursor in the html element and start typing "style" and you'll get a dropdown to auto complete. Then as you start typing each property Intellisense will kick in, after you finish the values for each add a semi-colon so it knows that you are ready to add a new property.

    If you use the New Styles dialogs you choose what type you want but I don't know of any way to make that a 100% default no matter how you create the style.


    MS MVP Expression Tutorials & Help http://by-expression.com
    • Marked as answer by Clif9710 Thursday, June 10, 2010 12:55 AM
    Wednesday, June 9, 2010 9:39 PM
  • The Style Toolbar > New Style button will get you the dialog box but if you use the Common or Format toolbar buttons to create your styles you will get inline styles.

    The difference is in the number of options you get. Many of the options in the New Styles dialog box are not suited to inline styles.


    MS MVP Expression Tutorials & Help http://by-expression.com
    • Marked as answer by Clif9710 Wednesday, June 9, 2010 3:25 AM
    Wednesday, June 9, 2010 1:39 AM

All replies

  • The settings in Page Editor Options are for the toolbars not using either the New Styles Panel or Format > New Style to get to the dialog boxes.
    MS MVP Expression Tutorials & Help http://by-expression.com
    Tuesday, June 8, 2010 7:59 PM
  • Cheryl, I'm confused. If I use the styles toolbar to create a style, it opens the same dialog box that appears when I select new style from the apply style panel.
    Tuesday, June 8, 2010 8:58 PM
  • The Style Toolbar > New Style button will get you the dialog box but if you use the Common or Format toolbar buttons to create your styles you will get inline styles.

    The difference is in the number of options you get. Many of the options in the New Styles dialog box are not suited to inline styles.


    MS MVP Expression Tutorials & Help http://by-expression.com
    • Marked as answer by Clif9710 Wednesday, June 9, 2010 3:25 AM
    Wednesday, June 9, 2010 1:39 AM
  • ok, I will give that a try.
    Wednesday, June 9, 2010 3:25 AM
  • If you're still there, Cheryl, I played around a bit and my question now boils down to - if I want to force an inline style no matter what (and I should be able to do that because even if there is a class or ID style applied, an inline style should still be possible in addition) how can I get EW to obey my request and stick with it as I move from element to element applying the inline styles that I want?

    Disregard whether this is not recommended or poor practice - I simply want to know if what I want to do is possible.

    If I set the style application toolbar to manual and inline style, then select an element, the application toolbar will revert to the class or ID of a style already applied to that element, even though I have de-selected "reuse properties" on the application toolbar. So to force the inline style, I have to reselect inline style.

    In short - I am looking for a set-it-once-and-forget-it way of applying inline styles, call me an inline style maniac if you will, but will EW allow me to be the maniac I want to be?

    • Marked as answer by Clif9710 Thursday, June 10, 2010 12:55 AM
    • Unmarked as answer by Clif9710 Thursday, June 10, 2010 12:55 AM
    Wednesday, June 9, 2010 9:26 PM
  • Work in code view if you want an inline style automatically. Put your cursor in the html element and start typing "style" and you'll get a dropdown to auto complete. Then as you start typing each property Intellisense will kick in, after you finish the values for each add a semi-colon so it knows that you are ready to add a new property.

    If you use the New Styles dialogs you choose what type you want but I don't know of any way to make that a 100% default no matter how you create the style.


    MS MVP Expression Tutorials & Help http://by-expression.com
    • Marked as answer by Clif9710 Thursday, June 10, 2010 12:55 AM
    Wednesday, June 9, 2010 9:39 PM